fix
This commit is contained in:
parent
ff749d80d4
commit
a69890c970
|
@ -1,7 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
require_once "../../../bootstrap.php";
|
require_once "../../../bootstrap.php";
|
||||||
|
require_once('../Group/Group.php');
|
||||||
use Backend\Models\GameData;
|
use Backend\Models\GameData;
|
||||||
use function Backend\Controllers\groupViaToken;
|
|
||||||
use Backend\Models\Group;
|
use Backend\Models\Group;
|
||||||
|
|
||||||
$isImages = false;
|
$isImages = false;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
namespace Backend\Controllers;
|
require_once "../../../bootstrap.php";
|
||||||
require "../../../bootstrap.php";
|
|
||||||
|
|
||||||
use Backend\Models\Group;
|
use Backend\Models\Group;
|
||||||
use Backend\Models\Password;
|
use Backend\Models\Password;
|
||||||
|
@ -12,6 +11,12 @@ use Backend\Models\Password;
|
||||||
|
|
||||||
function groupViaToken(string $token){
|
function groupViaToken(string $token){
|
||||||
|
|
||||||
$password = Password::firstWhere('remember_token', $token);
|
if($password = Password::firstWhere('remember_token', $token)){
|
||||||
return Group::find($password->group_id);
|
return Group::find($password->group_id);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isLogin(){
|
||||||
|
return isset($_SESSION["token"]);
|
||||||
}
|
}
|
|
@ -1,3 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
echo strlen($_SESSION['token']), PHP_EOL;
|
||||||
|
echo bin2hex($_SESSION['token']), PHP_EOL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print_r($_GET);
|
print_r($_GET);
|
Loading…
Reference in New Issue