Skip to content

Commit

Permalink
Paying attention to abs_root_url when creating redirects in login_ens…
Browse files Browse the repository at this point in the history
…ure_loggedin()
  • Loading branch information
migurski committed Nov 27, 2010
1 parent 3ba79cf commit 263611b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions include/lib_login.php
Expand Up @@ -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;
}
Expand Down

0 comments on commit 263611b

Please sign in to comment.