Skip to content

Commit

Permalink
Enable URL Recovery from logout
Browse files Browse the repository at this point in the history
  • Loading branch information
ssteeltm committed Apr 27, 2024
1 parent 5f0068a commit b8c529c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion check_login.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@

// 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?url=".urlencode($_SERVER["REQUEST_SCHEME"] . "://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]) );
exit;
}

Expand Down
6 changes: 4 additions & 2 deletions login.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,10 @@
//}

}

header("Location: $config_start_page");
if($_GET['url'])
header("Location: ".$_GET['url']);
else
header("Location: $config_start_page");

} else {

Expand Down

0 comments on commit b8c529c

Please sign in to comment.