Permalink
Browse files

Paying attention to abs_root_url when creating redirects in login_ens…

…ure_loggedin()
  • Loading branch information...
1 parent 3ba79cf commit 263611b83a56badeb5581fec8a4102e17247e652 migurski committed Nov 27, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 include/lib_login.php
View
@@ -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;
}

0 comments on commit 263611b

Please sign in to comment.