Skip to content
Snippets Groups Projects
Commit 41bd7f0e authored by Tim Repke's avatar Tim Repke
Browse files

now logout in admin panel is working

parent bbb39daa
No related branches found
No related tags found
No related merge requests found
......@@ -14,12 +14,17 @@ function generateNavigationItems($page, $menu)
function checkIfLogin()
{
if(isset($_GET['logout']))
setLoggedIn("");
if(!isset($_POST['user']) || !isset($_POST['password']))
return;
$user = $_POST['user'];
$password = $_POST['password'];
if (isValidUser($user, $password))
setLoggedIn($user);
}
......@@ -59,13 +64,20 @@ function isLoggedIn()
function setLoggedIn($user)
{
if ($user != "")
if ($user != ""){
comm_admin_verbose(2,"login");
$_SESSION['loggedIn'] = $user;
else
}else
{
comm_admin_verbose(2,"logout");
session_destroy();
header("location: ..");
}
}
function comm_admin_verbose($level, $text){
global $config_admin_verbose_level;
if($config_admin_verbose_level >= $level) echo $text.'<br />';
}
......@@ -3,6 +3,7 @@
// passwort manu:kuzerPenis666!
$config_verbose_level = 3; // 0 = nothing, 1 = important, 2 = somewhat important, 3 = detailed verbose
$config_admin_verbose_level = 3;
$config_db = array(
"name" => "fsfahrt",
......
......@@ -45,6 +45,14 @@
#admin-content{
}
#logout{
float:right;
height:20px;
width: 25px;
background: #f5f5f5;
color:#f5f5f5;
border:0 !important;
}
</style>
</head>
<body>
......@@ -55,6 +63,7 @@
<div id="linkbar">
{navigation}
<a href="?logout" id="logout">.</a>
</div>
</body>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment