Skip to content

Commit

Permalink
Merge pull request #948 from ssteeltm/master
Browse files Browse the repository at this point in the history
Enable URL Recovery from logout
  • Loading branch information
johnnyq authored May 5, 2024
2 parents c0fc957 + 76a34de commit aca1a13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions check_login.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@

// 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;
}

Expand Down Expand Up @@ -84,4 +88,3 @@
//if ($session_user_config_force_mfa == 1 && $session_token == NULL) {
// header("Location: force_mfa.php");
//}

8 changes: 5 additions & 3 deletions login.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,11 @@
//}

}

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
Expand Down

0 comments on commit aca1a13

Please sign in to comment.