Replace ExternalBackend::getRemoteUserEnvvars() with an attribute
refs #12164
This commit is contained in:
parent
f8501aa80d
commit
d9330486e9
|
@ -57,7 +57,7 @@ class ExternalBackendForm extends Form
|
|||
)
|
||||
);
|
||||
|
||||
foreach (ExternalBackend::getRemoteUserEnvvars() as $envvar) {
|
||||
foreach (ExternalBackend::$remoteUserEnvvars as $envvar) {
|
||||
if (ExternalBackend::getRemoteUser($envvar) !== null) {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -11,6 +11,13 @@ use Icinga\User;
|
|||
*/
|
||||
class ExternalBackend implements UserBackendInterface
|
||||
{
|
||||
/**
|
||||
* Possible variables where to read the user from
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public static $remoteUserEnvvars = array('REDIRECT_REMOTE_USER', 'REMOTE_USER');
|
||||
|
||||
/**
|
||||
* The name of this backend
|
||||
*
|
||||
|
@ -83,16 +90,6 @@ class ExternalBackend implements UserBackendInterface
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get possible variables where to read the user from
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public static function getRemoteUserEnvvars()
|
||||
{
|
||||
return array('REDIRECT_REMOTE_USER', 'REMOTE_USER');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
|
@ -33,7 +33,7 @@ class AuthenticationPage extends Form
|
|||
{
|
||||
if (isset($formData['type']) && $formData['type'] === 'external') {
|
||||
$hasRemoteUser = false;
|
||||
foreach (ExternalBackend::getRemoteUserEnvvars() as $envvar) {
|
||||
foreach (ExternalBackend::$remoteUserEnvvars as $envvar) {
|
||||
if (ExternalBackend::getRemoteUser($envvar) !== null) {
|
||||
$hasRemoteUser = true;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue