This commit is contained in:
2021-03-09 14:43:39 +01:00
parent ff749d80d4
commit a69890c970
3 changed files with 17 additions and 5 deletions
+2 -1
View File
@@ -1,7 +1,8 @@
<?php
require_once "../../../bootstrap.php";
require_once('../Group/Group.php');
use Backend\Models\GameData;
use function Backend\Controllers\groupViaToken;
use Backend\Models\Group;
$isImages = false;
+9 -4
View File
@@ -1,6 +1,5 @@
<?php
namespace Backend\Controllers;
require "../../../bootstrap.php";
require_once "../../../bootstrap.php";
use Backend\Models\Group;
use Backend\Models\Password;
@@ -12,6 +11,12 @@ use Backend\Models\Password;
function groupViaToken(string $token){
$password = Password::firstWhere('remember_token', $token);
return Group::find($password->group_id);
if($password = Password::firstWhere('remember_token', $token)){
return Group::find($password->group_id);
}
return null;
}
function isLogin(){
return isset($_SESSION["token"]);
}