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
This commit is contained in:
plegall
2010-05-04 22:21:11 +00:00
parent 2a4d98ed75
commit fe797be8d4
+18 -4
View File
@@ -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);
}
}
}