Fix regression with browser redirection
This commit is contained in:
parent
153a174930
commit
ed05a9f96c
@ -142,7 +142,7 @@
|
|||||||
/**
|
/**
|
||||||
* Log out with redirect
|
* Log out with redirect
|
||||||
*
|
*
|
||||||
* @param string $path URL path
|
* @param string $path URL path (without leading slash)
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function logOutWithRedirect($path = "") {
|
public function logOutWithRedirect($path = "") {
|
||||||
@ -173,11 +173,11 @@
|
|||||||
/**
|
/**
|
||||||
* Redirect browser and exit
|
* Redirect browser and exit
|
||||||
*
|
*
|
||||||
* @param string $path Redirect URL path
|
* @param string $path Redirect URL path (without leading slash)
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exitWithRedirect($path = "") {
|
public function exitWithRedirect($path = "") {
|
||||||
$location = str_replace("//", "/", BASE_URL . $path);
|
$location = BASE_URL . $path;
|
||||||
header("Location: $location");
|
header("Location: $location");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -110,6 +110,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate app base URL
|
* Calculate app base URL
|
||||||
|
* Returned URL has trailing slash.
|
||||||
*
|
*
|
||||||
* @return string URL
|
* @return string URL
|
||||||
*/
|
*/
|
||||||
|
@ -27,10 +27,10 @@
|
|||||||
$auth = new uAuth();
|
$auth = new uAuth();
|
||||||
|
|
||||||
if (!$auth->isAuthenticated() && $auth->isLoginAttempt()) {
|
if (!$auth->isAuthenticated() && $auth->isLoginAttempt()) {
|
||||||
$auth->exitWithRedirect("/login.php?auth_error=1");
|
$auth->exitWithRedirect("login.php?auth_error=1");
|
||||||
}
|
}
|
||||||
if (!$auth->isAuthenticated() && uConfig::$require_authentication) {
|
if (!$auth->isAuthenticated() && uConfig::$require_authentication) {
|
||||||
$auth->exitWithRedirect("/login.php");
|
$auth->exitWithRedirect("login.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user