Enable URL Recovery from logout

This commit is contained in:
Hugo Sampaio 2024-04-27 09:30:41 -03:00
parent 5f0068a64f
commit b8c529c2ec
2 changed files with 8 additions and 3 deletions

View File

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

View File

@ -218,8 +218,10 @@ if (isset($_POST['login'])) {
//}
}
header("Location: $config_start_page");
if($_GET['url'])
header("Location: ".$_GET['url']);
else
header("Location: $config_start_page");
} else {