Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Paying attention to abs_root_url when creating redirects in login_ens…

…ure_loggedin()
  • Loading branch information...
commit 263611b83a56badeb5581fec8a4102e17247e652 1 parent 3ba79cf
migurski authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 include/lib_login.php
View
8 include/lib_login.php
@@ -14,10 +14,14 @@ function login_ensure_loggedin($redir=null){
if ($GLOBALS['cfg']['user']['id']) return;
+ $base_url = isset($GLOBALS['cfg']) && isset($GLOBALS['cfg']['abs_root_url'])
+ ? rtrim($GLOBALS['cfg']['abs_root_url'], '/')
+ : '';
+
if ($redir){
- header("location: /signin/?redir=".urlencode($redir));
+ header("Location: {$base_url}/signin/?redir=".urlencode($redir));
}else{
- header("location: /signin/");
+ header("Location: {$base_url}/signin/");
}
exit;
}
Please sign in to comment.
Something went wrong with that request. Please try again.