mirror of
https://github.com/friendica/friendica
synced 2025-04-29 10:24:23 +02:00
Issue 13943: Notify users on login that they are blocked
This commit is contained in:
parent
c7c029a044
commit
7342c6e468
3 changed files with 75 additions and 61 deletions
|
@ -238,7 +238,7 @@ class Authentication
|
|||
$record = $this->dba->selectFirst(
|
||||
'user',
|
||||
[],
|
||||
['uid' => User::getIdFromPasswordAuthentication($username, $password)]
|
||||
['uid' => User::getIdFromPasswordAuthentication($username, $password, false, true)]
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
$this->logger->warning('authenticate: failed login attempt', ['action' => 'login', 'username' => $username, 'ip' => $this->remoteAddress]);
|
||||
|
@ -246,6 +246,12 @@ class Authentication
|
|||
$this->baseUrl->redirect();
|
||||
}
|
||||
|
||||
if ($record['blocked']) {
|
||||
$this->logger->warning('authenticate: user is blocked', ['action' => 'login', 'username' => $username, 'ip' => $this->remoteAddress]);
|
||||
DI::sysmsg()->addNotice($this->l10n->t('Login failed because your account is blocked.'));
|
||||
$this->baseUrl->redirect();
|
||||
}
|
||||
|
||||
if (!$remember) {
|
||||
$trusted = $this->cookie->get('2fa_cookie_hash') ?? null;
|
||||
$this->cookie->clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue