This commit is contained in:
RundelhausCode 2021-03-09 14:43:39 +01:00
parent ff749d80d4
commit a69890c970
3 changed files with 17 additions and 5 deletions

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;

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"]);
}

View File

@ -1,3 +1,9 @@
<?php
session_start();
echo strlen($_SESSION['token']), PHP_EOL;
echo bin2hex($_SESSION['token']), PHP_EOL;
print_r($_GET);