22 lines
395 B
PHP
22 lines
395 B
PHP
<?php
|
|
require_once "../../../bootstrap.php";
|
|
|
|
use Backend\Models\Group;
|
|
use Backend\Models\Password;
|
|
|
|
/**
|
|
* @param string $token
|
|
* @return Group;
|
|
*/
|
|
|
|
function groupViaToken(string $token){
|
|
|
|
if($password = Password::firstWhere('remember_token', $token)){
|
|
return Group::find($password->group_id);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function isLogin(){
|
|
return isset($_SESSION["token"]);
|
|
} |