mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
ExternalBackend::getRemoteUser(): restore previous default behavior
refs #12164
This commit is contained in:
parent
ab01d2f915
commit
4d6160d987
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user