after role back

This commit is contained in:
RundelhausCode 2021-03-26 11:00:45 +01:00
parent 0131511be1
commit bcb6bf0bf4
4 changed files with 38 additions and 27 deletions

View File

@ -8,3 +8,12 @@ function isAdmin(): bool
return isset($_SESSION['admin']); return isset($_SESSION['admin']);
} }
function makeAdminLogin(string $userName)
{
setcookie("userName", $userName, [
'expires' => 0,
'samesite' => 'Strict',
'path' => '/'
]);
}

View File

@ -20,6 +20,7 @@ if(isset($_POST['aLogin'])){
$_SESSION['admin'] = true; $_SESSION['admin'] = true;
$_SESSION['success'] = "You are now logged in"; $_SESSION['success'] = "You are now logged in";
http_response_code(200); http_response_code(200);
makeAdminLogin($userName);
}else{ }else{
session_destroy(); session_destroy();
http_response_code(401); http_response_code(401);

View File

@ -1,7 +1,7 @@
<?php <?php
session_start(); session_start();
session_unset();
session_destroy(); session_destroy();
$cookieCon = array( $cookieCon = array(
@ -11,5 +11,6 @@ $cookieCon = array(
); );
setcookie("groupName", null, $cookieCon); setcookie("groupName", null, $cookieCon);
setcookie("groupId", null, $cookieCon); setcookie("groupId", null, $cookieCon);
setcookie("userName", null, $cookieCon);
echo http_response_code(200); echo http_response_code(200);

52
composer.lock generated
View File

@ -103,16 +103,16 @@
}, },
{ {
"name": "illuminate/collections", "name": "illuminate/collections",
"version": "v8.32.1", "version": "v8.34.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/collections.git", "url": "https://github.com/illuminate/collections.git",
"reference": "d7cc717a00064b40fa63a8ad522042005e1de1ed" "reference": "e18d6e4cf03dd597bc3ecd86fefc2023d0c7a5e8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/collections/zipball/d7cc717a00064b40fa63a8ad522042005e1de1ed", "url": "https://api.github.com/repos/illuminate/collections/zipball/e18d6e4cf03dd597bc3ecd86fefc2023d0c7a5e8",
"reference": "d7cc717a00064b40fa63a8ad522042005e1de1ed", "reference": "e18d6e4cf03dd597bc3ecd86fefc2023d0c7a5e8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -153,20 +153,20 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "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", "name": "illuminate/container",
"version": "v8.32.1", "version": "v8.34.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/container.git", "url": "https://github.com/illuminate/container.git",
"reference": "3d6ce613f455093fdf8bd3c81b30104aef0b11e0" "reference": "0e38ee1632d470e56aece0079e6e22d13e6bea8e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/container/zipball/3d6ce613f455093fdf8bd3c81b30104aef0b11e0", "url": "https://api.github.com/repos/illuminate/container/zipball/0e38ee1632d470e56aece0079e6e22d13e6bea8e",
"reference": "3d6ce613f455093fdf8bd3c81b30104aef0b11e0", "reference": "0e38ee1632d470e56aece0079e6e22d13e6bea8e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -204,20 +204,20 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "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", "name": "illuminate/contracts",
"version": "v8.32.1", "version": "v8.34.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/contracts.git", "url": "https://github.com/illuminate/contracts.git",
"reference": "9c7a9868d7485a82663d67109429094c8e4ed56d" "reference": "121cea1d8b8772bc7fee99c71ecf0f57c1d77b3b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/contracts/zipball/9c7a9868d7485a82663d67109429094c8e4ed56d", "url": "https://api.github.com/repos/illuminate/contracts/zipball/121cea1d8b8772bc7fee99c71ecf0f57c1d77b3b",
"reference": "9c7a9868d7485a82663d67109429094c8e4ed56d", "reference": "121cea1d8b8772bc7fee99c71ecf0f57c1d77b3b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -252,20 +252,20 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "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", "name": "illuminate/database",
"version": "v8.32.1", "version": "v8.34.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/database.git", "url": "https://github.com/illuminate/database.git",
"reference": "f6a10cebd9bbd188ca66993168fb453439dbb50f" "reference": "74a165fd07b36cc0ea3558fa391b762867af87e8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/database/zipball/f6a10cebd9bbd188ca66993168fb453439dbb50f", "url": "https://api.github.com/repos/illuminate/database/zipball/74a165fd07b36cc0ea3558fa391b762867af87e8",
"reference": "f6a10cebd9bbd188ca66993168fb453439dbb50f", "reference": "74a165fd07b36cc0ea3558fa391b762867af87e8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -320,11 +320,11 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "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", "name": "illuminate/macroable",
"version": "v8.32.1", "version": "v8.34.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/macroable.git", "url": "https://github.com/illuminate/macroable.git",
@ -370,16 +370,16 @@
}, },
{ {
"name": "illuminate/support", "name": "illuminate/support",
"version": "v8.32.1", "version": "v8.34.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/support.git", "url": "https://github.com/illuminate/support.git",
"reference": "2ef7ff288366a1ebe32f633196a1b90bd443acc3" "reference": "b7b27e758b68aad44558c62e7374328835895386"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/support/zipball/2ef7ff288366a1ebe32f633196a1b90bd443acc3", "url": "https://api.github.com/repos/illuminate/support/zipball/b7b27e758b68aad44558c62e7374328835895386",
"reference": "2ef7ff288366a1ebe32f633196a1b90bd443acc3", "reference": "b7b27e758b68aad44558c62e7374328835895386",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -434,7 +434,7 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "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", "name": "nesbot/carbon",