Show only the most important warning on the login page

This commit is contained in:
Johannes Meyer 2014-11-12 16:23:55 +01:00
parent 2eb9a771c9
commit 259a465f97
3 changed files with 17 additions and 9 deletions

View File

@ -104,30 +104,30 @@ class AuthenticationController extends ActionController
}
}
if ($backendsTried === 0) {
throw new ConfigurationError(
$this->view->form->addError(
$this->translate(
'No authentication methods available. Did you create'
. ' authentication.ini when setting up Icinga Web 2?'
)
);
}
if ($backendsTried === $backendsWithError) {
throw new ConfigurationError(
} else if ($backendsTried === $backendsWithError) {
$this->view->form->addError(
$this->translate(
'All configured authentication methods failed.'
. ' Please check the system log or Icinga Web 2 log for more information.'
)
);
}
if ($backendsWithError) {
$this->view->form->getElement('username')->addError(
} elseif ($backendsWithError) {
$this->view->form->addError(
$this->translate(
'Please note that not all authentication methods were available.'
. ' Check the system log or Icinga Web 2 log for more information.'
)
);
}
$this->view->form->getElement('password')->addError($this->translate('Incorrect username or password'));
if ($backendsTried > 0 && $backendsTried !== $backendsWithError) {
$this->view->form->getElement('password')->addError($this->translate('Incorrect username or password'));
}
} elseif ($request->isGet()) {
$user = new User('');
foreach ($chain as $backend) {

View File

@ -121,6 +121,10 @@ form.link-like input[type="submit"]:hover, form.link-like input[type="submit"]:f
list-style-type: none;
margin: 0;
padding: 0;
li {
margin: 0.5em;
}
}
form div.element ul.errors {
@ -137,7 +141,7 @@ form div.element ul.errors {
form ul.form-errors {
.non-list-like-list;
display: inline-block;
padding: 0.5em 1em;
margin-bottom: 1em;
border-radius: 1em;
background-color: @colorCritical;

View File

@ -53,6 +53,10 @@
.form div.element {
margin: 0;
ul.errors {
margin-left: 9.5em;
}
}
.form label {