Commit b648161a authored by Franco Fichtner's avatar Franco Fichtner

inc: fixes #86 and consolidates usage to REQUEST_URI

Let's trust the routing on this one, so that when we have it we
won't trip over this stuff again...
parent 3ba3cba1
...@@ -1321,7 +1321,7 @@ function authenticate_user($username, $password, $authcfg = NULL, &$attributes = ...@@ -1321,7 +1321,7 @@ function authenticate_user($username, $password, $authcfg = NULL, &$attributes =
} }
function session_auth() { function session_auth() {
global $config, $_SESSION, $page; global $config, $_SESSION;
// Handle HTTPS httponly and secure flags // Handle HTTPS httponly and secure flags
$currentCookieParams = session_get_cookie_params(); $currentCookieParams = session_get_cookie_params();
...@@ -1357,9 +1357,7 @@ function session_auth() { ...@@ -1357,9 +1357,7 @@ function session_auth() {
if (isset($_POST['postafterlogin'])) if (isset($_POST['postafterlogin']))
return true; return true;
else { else {
if (empty($page)) header("Location: {$_SERVER['REQUEST_URI']}");
$page = "/";
header("Location: {$page}");
} }
exit; exit;
} else { } else {
......
...@@ -59,7 +59,7 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) { ...@@ -59,7 +59,7 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
if (!empty($_SERVER['REMOTE_ADDR'])) { if (!empty($_SERVER['REMOTE_ADDR'])) {
$username .= '@' . $_SERVER['REMOTE_ADDR']; $username .= '@' . $_SERVER['REMOTE_ADDR'];
} }
log_error("{$username} attempted to access {$_SERVER['SCRIPT_NAME']} but does not have access to that page. Redirecting to {$page}."); log_error("{$username} attempted to access {$_SERVER['REQUEST_URI']} but does not have access to that page. Redirecting to {$page}.");
exit; exit;
} else { } else {
...@@ -252,7 +252,7 @@ function display_login_form() ...@@ -252,7 +252,7 @@ function display_login_form()
<div class="login-modal-content"> <div class="login-modal-content">
<div id="inputerrors"><?=$_SESSION['Login_Error'];?></div> <div id="inputerrors"><?=$_SESSION['Login_Error'];?></div>
<form class="clearfix" id="iform" name="iform" method="post" <?= $loginautocomplete ?> action="<?=$_SERVER['SCRIPT_NAME'];?>"> <form class="clearfix" id="iform" name="iform" method="post" <?= $loginautocomplete ?> action="<?=$_SERVER['REQUEST_URI'];?>">
<div class="form-group"> <div class="form-group">
<label for="usernamefld"><?=gettext("Username:"); ?>*</label> <label for="usernamefld"><?=gettext("Username:"); ?>*</label>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment