Handle logout
authorJoey Schulze <joey@infodrom.org>
Fri, 26 Feb 2010 22:37:06 +0000 (23:37 +0100)
committerJoey Schulze <joey@infodrom.org>
Fri, 26 Feb 2010 22:37:06 +0000 (23:37 +0100)
lib/general.php

index 6216e34..524be12 100644 (file)
@@ -7,6 +7,12 @@ function passwd($login,$pass)
 
 function check_session()
 {
 
 function check_session()
 {
+  if (!empty($_SESSION['sys']['login']) && !empty($_GET['logout'])) {
+    session_destroy();
+    header('Location: ./?login=true');
+    exit();
+  }
+
   if (!empty($_POST['login']) && !empty($_POST['passwd'])) {
     require_once('lib/login.php');
     if (check_passwd()) {
   if (!empty($_POST['login']) && !empty($_POST['passwd'])) {
     require_once('lib/login.php');
     if (check_passwd()) {