setup: Display a note in case autologin is chosen while not being logged in

In case the user chooses to use autologin as authentication while not being
externally authenticated a note is displayed indicating that it is necessary
to set up the webserver's authentication to be able to login once the wizard
is complete.

refs #8274
This commit is contained in:
Johannes Meyer 2015-01-26 16:58:40 +01:00
parent 45408e45af
commit 0fa133abfb
2 changed files with 37 additions and 0 deletions

View File

@ -36,6 +36,32 @@ class AuthenticationPage extends Form
)
)
);
if (isset($formData['type']) && $formData['type'] === 'autologin' && !isset($_SERVER['REMOTE_USER'])) {
$this->addElement(
'note',
'autologin_note',
array(
'value' => sprintf(
$this->translate(
'You\'re currently not authenticated using any of the web server\'s authentication '
. 'mechanisms. Make sure you\'ll configure such either by using the %s or by setting'
. ' it up manually, otherwise you\'ll not be able to log into Icinga Web 2 once the '
. 'wizard is complete.'
),
'<em title="icingacli help setup config webserver">IcingaCLI</em>'
),
'decorators' => array(
'ViewHelper',
array(
'HtmlTag',
array('tag' => 'p', 'class' => 'icon-info info')
)
)
)
);
}
$this->addElement(
'note',
'description',
@ -61,6 +87,7 @@ class AuthenticationPage extends Form
'type',
array(
'required' => true,
'autosubmit' => true,
'label' => $this->translate('Authentication Type'),
'description' => $this->translate('The type of authentication to use when accessing Icinga Web 2'),
'multiOptions' => $backendTypes

View File

@ -220,6 +220,16 @@
}
}
#setup_authentication_type p.info {
padding: 0.5em;
border: 1px solid lightgrey;
background-color: infobackground;
em {
text-decoration: underline;
}
}
#setup_ldap_discovery_confirm table {
margin: 1em 0;
border-collapse: separate;