/logout/
This commit is contained in:
@@ -9,11 +9,8 @@ $err = false;
|
||||
if (key_exists('username', $_GET) && key_exists('password', $_GET) && key_exists('redirect', $_GET))
|
||||
{
|
||||
if ($_GET['username'] === $CONFIG['admin_username'] && $_GET['password'] === $CONFIG['admin_password'])
|
||||
{
|
||||
$expires = time() + (24*60*60); // 24h
|
||||
$hash = hash('sha256', $_GET['username'] . ';' . $_GET['password']);
|
||||
setcookie('mikescher_auth', $hash, $expires);
|
||||
|
||||
{
|
||||
setLoginCookie($_GET['username'], $_GET['password']);
|
||||
header('Location: ' . $_GET['redirect']);
|
||||
die();
|
||||
}
|
||||
|
||||
25
www/pages/logout.php
Normal file
25
www/pages/logout.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
require_once (__DIR__ . '/../internals/base.php');
|
||||
global $OPTIONS;
|
||||
|
||||
$redirect = $OPTIONS['logout_target'];
|
||||
|
||||
clearLoginCookie();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Mikescher.com - Logout</title>
|
||||
<link rel="icon" type="image/png" href="/data/images/favicon.png"/>
|
||||
<link rel="canonical" href="https://www.mikescher.com/logout"/>
|
||||
<meta http-equiv="refresh" content="1; url=<?php echo $redirect; ?>" />
|
||||
</head>
|
||||
<body>
|
||||
You have been logged out
|
||||
<script>
|
||||
setTimeout(function () { window.location.href = "<?php echo $redirect; ?>"; }, 1000);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user