ExternalBackend::getRemoteUser(): restore previous default behavior

refs #12164
This commit is contained in:
Alexander A. Klimov 2016-10-18 10:22:06 +02:00
parent ab01d2f915
commit 4d6160d987

View File

@ -67,9 +67,12 @@ class ExternalBackend implements UserBackendInterface
*
* @return string|null
*/
public static function getRemoteUser($variable = 'REMOTE_USER')
public static function getRemoteUser($variable = null)
{
foreach (($variable === null ? array('REMOTE_USER', 'REDIRECT_REMOTE_USER') : array($variable)) as $variable) {
if ($variable === null) {
$variable = 'REMOTE_USER';
}
$username = getenv($variable);
if ($username !== false) {
return $username;
@ -77,7 +80,6 @@ class ExternalBackend implements UserBackendInterface
if (array_key_exists($variable, $_SERVER)) {
return $_SERVER[$variable];
}
}
return null;
}