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,16 +67,18 @@ class ExternalBackend implements UserBackendInterface
* *
* @return string|null * @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) {
$username = getenv($variable); $variable = 'REMOTE_USER';
if ($username !== false) { }
return $username;
} $username = getenv($variable);
if (array_key_exists($variable, $_SERVER)) { if ($username !== false) {
return $_SERVER[$variable]; return $username;
} }
if (array_key_exists($variable, $_SERVER)) {
return $_SERVER[$variable];
} }
return null; return null;
} }