aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-05-04 22:21:11 +0000
committerplegall <plg@piwigo.org>2010-05-04 22:21:11 +0000
commitfe797be8d4a27c0501ea59ff1260c628a91eed21 (patch)
tree54c5642ca68b55d14025dcbf2e367c67da2fc83a
parent2a4d98ed7553bc5dffabb352591d1c1b2bf497c0 (diff)
bug 1501 fixed: with apache_authentication, fall back to REDIRECT_REMOTE_USER
if REMOTE_USER is not set. git-svn-id: http://piwigo.org/svn/trunk@6074 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--include/user.inc.php22
1 files changed, 18 insertions, 4 deletions
diff --git a/include/user.inc.php b/include/user.inc.php
index b21fba77a..9e0eab847 100644
--- a/include/user.inc.php
+++ b/include/user.inc.php
@@ -50,12 +50,26 @@ if (session_id()=="")
}
// using Apache authentication override the above user search
-if ($conf['apache_authentication'] and isset($_SERVER['REMOTE_USER']))
+if ($conf['apache_authentication'])
{
- if (!($user['id'] = get_userid($_SERVER['REMOTE_USER'])))
+ $remote_user = null;
+ foreach (array('REMOTE_USER', 'REDIRECT_REMOTE_USER') as $server_key)
{
- register_user($_SERVER['REMOTE_USER'], '', '', false);
- $user['id'] = get_userid($_SERVER['REMOTE_USER']);
+ if (isset($_SERVER[$server_key]))
+ {
+ $remote_user = $_SERVER[$server_key];
+ echo $server_key;
+ break;
+ }
+ }
+
+ if (isset($remote_user))
+ {
+ if (!($user['id'] = get_userid($remote_user)))
+ {
+ register_user($remote_user, '', '', false);
+ $user['id'] = get_userid($remote_user);
+ }
}
}