Merge pull request #948 from ssteeltm/master
Enable URL Recovery from logout
This commit is contained in:
@@ -18,7 +18,11 @@ if (!isset($config_enable_setup) || $config_enable_setup == 1) {
|
|||||||
|
|
||||||
// Check user is logged in with a valid session
|
// Check user is logged in with a valid session
|
||||||
if (!isset($_SESSION['logged']) || !$_SESSION['logged']) {
|
if (!isset($_SESSION['logged']) || !$_SESSION['logged']) {
|
||||||
header("Location: login.php");
|
if ($_SERVER["REQUEST_URI"] == "/") {
|
||||||
|
header("Location: login.php");
|
||||||
|
} else {
|
||||||
|
header("Location: login.php?last_visited=" . base64_encode($_SERVER["REQUEST_URI"]) );
|
||||||
|
}
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,4 +88,3 @@ $num_notifications = $row['num'];
|
|||||||
//if ($session_user_config_force_mfa == 1 && $session_token == NULL) {
|
//if ($session_user_config_force_mfa == 1 && $session_token == NULL) {
|
||||||
// header("Location: force_mfa.php");
|
// header("Location: force_mfa.php");
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|||||||
@@ -218,9 +218,11 @@ if (isset($_POST['login'])) {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if ($_GET['last_visited']) {
|
||||||
header("Location: $config_start_page");
|
header("Location: ".$_SERVER["REQUEST_SCHEME"] . "://" . $config_base_url . base64_decode($_GET['last_visited']) );
|
||||||
|
} else {
|
||||||
|
header("Location: $config_start_page");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// MFA is configured and needs to be confirmed, or was unsuccessful
|
// MFA is configured and needs to be confirmed, or was unsuccessful
|
||||||
|
|||||||
Reference in New Issue
Block a user