mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
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:
+18
-4
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user