mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
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) {
|
if (ExternalBackend::getRemoteUser($envvar) !== null) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,13 @@ use Icinga\User;
|
|||||||
*/
|
*/
|
||||||
class ExternalBackend implements UserBackendInterface
|
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
|
* The name of this backend
|
||||||
*
|
*
|
||||||
@ -83,16 +90,6 @@ class ExternalBackend implements UserBackendInterface
|
|||||||
return null;
|
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}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@ -33,7 +33,7 @@ class AuthenticationPage extends Form
|
|||||||
{
|
{
|
||||||
if (isset($formData['type']) && $formData['type'] === 'external') {
|
if (isset($formData['type']) && $formData['type'] === 'external') {
|
||||||
$hasRemoteUser = false;
|
$hasRemoteUser = false;
|
||||||
foreach (ExternalBackend::getRemoteUserEnvvars() as $envvar) {
|
foreach (ExternalBackend::$remoteUserEnvvars as $envvar) {
|
||||||
if (ExternalBackend::getRemoteUser($envvar) !== null) {
|
if (ExternalBackend::getRemoteUser($envvar) !== null) {
|
||||||
$hasRemoteUser = true;
|
$hasRemoteUser = true;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user