ExternalBackendForm: Remove option to configure where to fetch a remote user
refs #12164
This commit is contained in:
parent
3a816ce0f7
commit
2c817215cb
|
@ -3,7 +3,6 @@
|
|||
|
||||
namespace Icinga\Forms\Config\UserBackend;
|
||||
|
||||
use Icinga\Authentication\User\ExternalBackend;
|
||||
use Zend_Validate_Callback;
|
||||
use Icinga\Web\Form;
|
||||
|
||||
|
@ -56,31 +55,6 @@ class ExternalBackendForm extends Form
|
|||
'validators' => array($callbackValidator)
|
||||
)
|
||||
);
|
||||
|
||||
$hasRemoteUser = false;
|
||||
foreach (ExternalBackend::$remoteUserEnvvars as $envvar) {
|
||||
if (ExternalBackend::getRemoteUser($envvar) !== null) {
|
||||
$hasRemoteUser = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (! $hasRemoteUser) {
|
||||
$envvar = 'REMOTE_USER';
|
||||
}
|
||||
|
||||
$this->addElement(
|
||||
'text',
|
||||
'username_envvar',
|
||||
array(
|
||||
'label' => $this->translate('Username Environment Variable'),
|
||||
'description' => $this->translate(
|
||||
'The environment variable the webserver assigns the authenticated user\'s name to.'
|
||||
),
|
||||
'required' => true,
|
||||
'value' => $envvar
|
||||
)
|
||||
);
|
||||
|
||||
$this->addElement(
|
||||
'hidden',
|
||||
'backend',
|
||||
|
|
|
@ -270,7 +270,7 @@ class AdminAccountPage extends Form
|
|||
*/
|
||||
protected function getUsername()
|
||||
{
|
||||
$name = ExternalBackend::getRemoteUser($this->backendConfig['username_envvar']);
|
||||
list($name, $_) = ExternalBackend::getRemoteUserInformation();
|
||||
if ($name === null) {
|
||||
return '';
|
||||
}
|
||||
|
|
|
@ -32,14 +32,8 @@ class AuthenticationPage extends Form
|
|||
public function createElements(array $formData)
|
||||
{
|
||||
if (isset($formData['type']) && $formData['type'] === 'external') {
|
||||
$hasRemoteUser = false;
|
||||
foreach (ExternalBackend::$remoteUserEnvvars as $envvar) {
|
||||
if (ExternalBackend::getRemoteUser($envvar) !== null) {
|
||||
$hasRemoteUser = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (! $hasRemoteUser) {
|
||||
list($username, $_) = ExternalBackend::getRemoteUserInformation();
|
||||
if ($username === null) {
|
||||
$this->info(
|
||||
$this->translate(
|
||||
'You\'re currently not authenticated using any of the web server\'s authentication '
|
||||
|
|
Loading…
Reference in New Issue