Game-Jaming/Backend/Controllers/Group/Group.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"]);
}