2021-03-11 08:28:30 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
*/
|
2021-03-12 10:10:14 +00:00
|
|
|
function isAdmin(): bool
|
|
|
|
{
|
2021-03-11 08:28:30 +00:00
|
|
|
session_start();
|
|
|
|
return isset($_SESSION['admin']);
|
|
|
|
}
|
|
|
|
|
2021-03-26 13:03:02 +00:00
|
|
|
/**
|
|
|
|
* @param string $userName
|
|
|
|
*/
|
2021-03-26 10:00:45 +00:00
|
|
|
function makeAdminLogin(string $userName)
|
|
|
|
{
|
|
|
|
setcookie("userName", $userName, [
|
|
|
|
'expires' => 0,
|
|
|
|
'samesite' => 'Strict',
|
|
|
|
'path' => '/'
|
|
|
|
]);
|
|
|
|
}
|
2021-04-20 06:51:48 +00:00
|
|
|
//test
|
2021-03-26 10:00:45 +00:00
|
|
|
|