Merge pull request #948 from ssteeltm/master

Enable URL Recovery from logout
This commit is contained in:
Johnny 2024-05-05 14:29:40 -04:00 committed by GitHub
commit aca1a13104
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 5 deletions

View File

@ -18,7 +18,11 @@ if (!isset($config_enable_setup) || $config_enable_setup == 1) {
// Check user is logged in with a valid session
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;
}
@ -84,4 +88,3 @@ $num_notifications = $row['num'];
//if ($session_user_config_force_mfa == 1 && $session_token == NULL) {
// header("Location: force_mfa.php");
//}

View File

@ -218,9 +218,11 @@ if (isset($_POST['login'])) {
//}
}
header("Location: $config_start_page");
if ($_GET['last_visited']) {
header("Location: ".$_SERVER["REQUEST_SCHEME"] . "://" . $config_base_url . base64_decode($_GET['last_visited']) );
} else {
header("Location: $config_start_page");
}
} else {
// MFA is configured and needs to be confirmed, or was unsuccessful