after role back
This commit is contained in:
parent
0131511be1
commit
bcb6bf0bf4
|
@ -8,3 +8,12 @@ function isAdmin(): bool
|
|||
return isset($_SESSION['admin']);
|
||||
}
|
||||
|
||||
function makeAdminLogin(string $userName)
|
||||
{
|
||||
setcookie("userName", $userName, [
|
||||
'expires' => 0,
|
||||
'samesite' => 'Strict',
|
||||
'path' => '/'
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ if(isset($_POST['aLogin'])){
|
|||
$_SESSION['admin'] = true;
|
||||
$_SESSION['success'] = "You are now logged in";
|
||||
http_response_code(200);
|
||||
makeAdminLogin($userName);
|
||||
}else{
|
||||
session_destroy();
|
||||
http_response_code(401);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
session_start();
|
||||
|
||||
session_unset();
|
||||
session_destroy();
|
||||
|
||||
$cookieCon = array(
|
||||
|
@ -11,5 +11,6 @@ $cookieCon = array(
|
|||
);
|
||||
setcookie("groupName", null, $cookieCon);
|
||||
setcookie("groupId", null, $cookieCon);
|
||||
setcookie("userName", null, $cookieCon);
|
||||
|
||||
echo http_response_code(200);
|
|
@ -103,16 +103,16 @@
|
|||
},
|
||||
{
|
||||
"name": "illuminate/collections",
|
||||
"version": "v8.32.1",
|
||||
"version": "v8.34.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/collections.git",
|
||||
"reference": "d7cc717a00064b40fa63a8ad522042005e1de1ed"
|
||||
"reference": "e18d6e4cf03dd597bc3ecd86fefc2023d0c7a5e8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/collections/zipball/d7cc717a00064b40fa63a8ad522042005e1de1ed",
|
||||
"reference": "d7cc717a00064b40fa63a8ad522042005e1de1ed",
|
||||
"url": "https://api.github.com/repos/illuminate/collections/zipball/e18d6e4cf03dd597bc3ecd86fefc2023d0c7a5e8",
|
||||
"reference": "e18d6e4cf03dd597bc3ecd86fefc2023d0c7a5e8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -153,20 +153,20 @@
|
|||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2021-03-08T17:22:22+00:00"
|
||||
"time": "2021-03-19T00:05:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/container",
|
||||
"version": "v8.32.1",
|
||||
"version": "v8.34.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/container.git",
|
||||
"reference": "3d6ce613f455093fdf8bd3c81b30104aef0b11e0"
|
||||
"reference": "0e38ee1632d470e56aece0079e6e22d13e6bea8e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/container/zipball/3d6ce613f455093fdf8bd3c81b30104aef0b11e0",
|
||||
"reference": "3d6ce613f455093fdf8bd3c81b30104aef0b11e0",
|
||||
"url": "https://api.github.com/repos/illuminate/container/zipball/0e38ee1632d470e56aece0079e6e22d13e6bea8e",
|
||||
"reference": "0e38ee1632d470e56aece0079e6e22d13e6bea8e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -204,20 +204,20 @@
|
|||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2021-02-12T21:15:27+00:00"
|
||||
"time": "2021-03-16T19:42:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/contracts",
|
||||
"version": "v8.32.1",
|
||||
"version": "v8.34.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/contracts.git",
|
||||
"reference": "9c7a9868d7485a82663d67109429094c8e4ed56d"
|
||||
"reference": "121cea1d8b8772bc7fee99c71ecf0f57c1d77b3b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/contracts/zipball/9c7a9868d7485a82663d67109429094c8e4ed56d",
|
||||
"reference": "9c7a9868d7485a82663d67109429094c8e4ed56d",
|
||||
"url": "https://api.github.com/repos/illuminate/contracts/zipball/121cea1d8b8772bc7fee99c71ecf0f57c1d77b3b",
|
||||
"reference": "121cea1d8b8772bc7fee99c71ecf0f57c1d77b3b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -252,20 +252,20 @@
|
|||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2021-02-26T13:17:03+00:00"
|
||||
"time": "2021-03-12T14:45:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/database",
|
||||
"version": "v8.32.1",
|
||||
"version": "v8.34.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/database.git",
|
||||
"reference": "f6a10cebd9bbd188ca66993168fb453439dbb50f"
|
||||
"reference": "74a165fd07b36cc0ea3558fa391b762867af87e8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/database/zipball/f6a10cebd9bbd188ca66993168fb453439dbb50f",
|
||||
"reference": "f6a10cebd9bbd188ca66993168fb453439dbb50f",
|
||||
"url": "https://api.github.com/repos/illuminate/database/zipball/74a165fd07b36cc0ea3558fa391b762867af87e8",
|
||||
"reference": "74a165fd07b36cc0ea3558fa391b762867af87e8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -320,11 +320,11 @@
|
|||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2021-03-09T14:06:15+00:00"
|
||||
"time": "2021-03-23T15:12:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/macroable",
|
||||
"version": "v8.32.1",
|
||||
"version": "v8.34.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/macroable.git",
|
||||
|
@ -370,16 +370,16 @@
|
|||
},
|
||||
{
|
||||
"name": "illuminate/support",
|
||||
"version": "v8.32.1",
|
||||
"version": "v8.34.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/support.git",
|
||||
"reference": "2ef7ff288366a1ebe32f633196a1b90bd443acc3"
|
||||
"reference": "b7b27e758b68aad44558c62e7374328835895386"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/support/zipball/2ef7ff288366a1ebe32f633196a1b90bd443acc3",
|
||||
"reference": "2ef7ff288366a1ebe32f633196a1b90bd443acc3",
|
||||
"url": "https://api.github.com/repos/illuminate/support/zipball/b7b27e758b68aad44558c62e7374328835895386",
|
||||
"reference": "b7b27e758b68aad44558c62e7374328835895386",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -434,7 +434,7 @@
|
|||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2021-03-05T15:22:14+00:00"
|
||||
"time": "2021-03-21T13:37:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nesbot/carbon",
|
||||
|
|
Loading…
Reference in New Issue