parent
1a5e64eda9
commit
41acffdc24
|
@ -3,6 +3,7 @@
|
|||
|
||||
namespace Icinga\Forms\Authentication;
|
||||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Authentication\Auth;
|
||||
use Icinga\Authentication\User\ExternalBackend;
|
||||
use Icinga\User;
|
||||
|
@ -87,6 +88,9 @@ class LoginForm extends Form
|
|||
$authChain = $auth->getAuthChain();
|
||||
$authChain->setSkipExternalBackends(true);
|
||||
$user = new User($this->getElement('username')->getValue());
|
||||
if (! $user->hasDomain()) {
|
||||
$user->setDomain(Config::app()->get('authentication', 'default_domain'));
|
||||
}
|
||||
$password = $this->getElement('password')->getValue();
|
||||
$authenticated = $authChain->authenticate($user, $password);
|
||||
if ($authenticated) {
|
||||
|
|
|
@ -259,6 +259,9 @@ class Auth
|
|||
foreach ($this->getAuthChain() as $userBackend) {
|
||||
if ($userBackend instanceof ExternalBackend) {
|
||||
if ($userBackend->authenticate($user)) {
|
||||
if (! $user->hasDomain()) {
|
||||
$user->setDomain(Config::app()->get('authentication', 'default_domain'));
|
||||
}
|
||||
$this->setAuthenticated($user);
|
||||
return true;
|
||||
}
|
||||
|
@ -293,6 +296,9 @@ class Auth
|
|||
return false;
|
||||
}
|
||||
$user = new User($credentials[0]);
|
||||
if (! $user->hasDomain()) {
|
||||
$user->setDomain(Config::app()->get('authentication', 'default_domain'));
|
||||
}
|
||||
$password = $credentials[1];
|
||||
if ($this->getAuthChain()->setSkipExternalBackends(true)->authenticate($user, $password)) {
|
||||
$this->setAuthenticated($user, false);
|
||||
|
|
Loading…
Reference in New Issue