Gestion d'un compte non enregistré

This commit is contained in:
Fred Tempez 2020-06-26 21:02:41 +02:00
parent eeeb5c3db8
commit 0ed4582cf0
1 changed files with 63 additions and 66 deletions

View File

@ -361,12 +361,10 @@ class user extends common {
$this->addOutput([
'notification' => $notification
]);
}
/**
* Le compte existe
*/
} else {
// Cas 4 : le délai de blocage est dépassé et le compte est au max - Réinitialiser
if ($this->getData(['user',$userId,'connectTimeout']) + $this->getData(['config', 'connect', 'timeout']) < time()
AND $this->getData(['user',$userId,'connectFail']) === $this->getData(['config', 'connect', 'attempt']) ) {
@ -396,8 +394,7 @@ class user extends common {
'redirect' => helper::baseUrl(),
'state' => false
]);
}
else {
} else {
// Valeurs en sortie
$this->addOutput([
'notification' => 'Connexion réussie',
@ -405,9 +402,8 @@ class user extends common {
'state' => true
]);
}
}
// Sinon notification d'échec
else {
} else {
$notification = 'Identifiant ou mot de passe incorrect';
// Cas 1 le nombre de connexions est inférieur aux tentatives autorisées : incrément compteur d'échec
if ($this->getData(['user',$userId,'connectFail']) < $this->getData(['config', 'connect', 'attempt'])) {
@ -436,6 +432,7 @@ class user extends common {
]);
}
}
}
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_LIGHT,