Răsfoiți Sursa

Login: Minor session adjustment to /index.php (allows refresh to change background image, like /login.php).

Nate Jones 11 ani în urmă
părinte
comite
74905218c9
1 a modificat fișierele cu 7 adăugiri și 1 ștergeri
  1. 7 1
      index.php

+ 7 - 1
index.php

@@ -25,7 +25,7 @@
 */
 */
 include "root.php";
 include "root.php";
 
 
-//clear the session variables
+// start the session
 	session_start();
 	session_start();
 
 
 //if config.php file does not exist then redirect to the install page
 //if config.php file does not exist then redirect to the install page
@@ -45,6 +45,12 @@ include "root.php";
 		exit;
 		exit;
 	}
 	}
 
 
+// if not logged in, clear the session variables
+if (strlen($_SESSION["username"]) == 0) {
+	session_unset();
+	session_destroy();
+}
+
 //adds multiple includes
 //adds multiple includes
 	require_once "resources/require.php";
 	require_once "resources/require.php";