mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 15:54:03 +02:00
Merge pull request #3856 from Icinga/feature/send-failed-login-attempts-to-the-audit-log-3855
Send failed login-attempts to the audit log
This commit is contained in:
commit
5d87f6712e
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
namespace Icinga\Authentication;
|
namespace Icinga\Authentication;
|
||||||
|
|
||||||
|
use Icinga\Application\Hook\AuditHook;
|
||||||
use Iterator;
|
use Iterator;
|
||||||
use Icinga\Application\Config;
|
use Icinga\Application\Config;
|
||||||
use Icinga\Application\Logger;
|
use Icinga\Application\Logger;
|
||||||
@ -123,13 +124,17 @@ class AuthChain implements Authenticatable, Iterator
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($backendsTried === 0) {
|
if ($backendsTried === 0) {
|
||||||
$this->error = static::EEMPTY;
|
$this->error = static::EEMPTY;
|
||||||
} elseif ($backendsTried === $backendsWithError) {
|
} elseif ($backendsTried === $backendsWithError) {
|
||||||
$this->error = static::EFAIL;
|
$this->error = static::EFAIL;
|
||||||
} elseif ($backendsWithError) {
|
} elseif ($backendsWithError) {
|
||||||
$this->error = static::ENOTALL;
|
$this->error = static::ENOTALL;
|
||||||
|
} else {
|
||||||
|
AuditHook::logActivity('login-failed', 'User failed to authenticate', null, $user->getUsername());
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user