diff --git a/application/controllers/AuthenticationController.php b/application/controllers/AuthenticationController.php index 22d309f04..441a84dee 100644 --- a/application/controllers/AuthenticationController.php +++ b/application/controllers/AuthenticationController.php @@ -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) { diff --git a/public/css/icinga/forms.less b/public/css/icinga/forms.less index e3cf1f685..bf2f600c5 100644 --- a/public/css/icinga/forms.less +++ b/public/css/icinga/forms.less @@ -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; diff --git a/public/css/icinga/login.less b/public/css/icinga/login.less index 704f84b8f..559ba1165 100644 --- a/public/css/icinga/login.less +++ b/public/css/icinga/login.less @@ -53,6 +53,10 @@ .form div.element { margin: 0; + + ul.errors { + margin-left: 9.5em; + } } .form label {