Logout: Prevent SQL error on logout if already logged out in a different window/tab.

This commit is contained in:
Nate Jones 2015-04-12 19:48:29 +00:00
parent a4a76efb49
commit b3cbbbfa7e
1 changed files with 68 additions and 66 deletions

View File

@ -28,6 +28,7 @@ include "root.php";
require_once "resources/require.php"; require_once "resources/require.php";
//check for login return preference //check for login return preference
if ($_SESSION["user_uuid"] != '') {
if ($_SESSION['login']['destination_last']['boolean'] == 'true') { if ($_SESSION['login']['destination_last']['boolean'] == 'true') {
if ($_SERVER['HTTP_REFERER'] != '') { if ($_SERVER['HTTP_REFERER'] != '') {
//convert to relative path //convert to relative path
@ -101,6 +102,7 @@ require_once "resources/require.php";
$db->exec(check_sql($sql)); $db->exec(check_sql($sql));
unset($sql); unset($sql);
} }
}
//redirect the user to the index page //redirect the user to the index page
header("Location: ".PROJECT_PATH."/login.php"); header("Location: ".PROJECT_PATH."/login.php");