RAZ données de blocage

This commit is contained in:
fredtempez 2020-12-28 21:08:33 +01:00
parent 8efafd9683
commit 258ebce4a1
2 changed files with 6 additions and 6 deletions

View File

@ -86,6 +86,7 @@ class common {
public static $inputBefore = []; public static $inputBefore = [];
public static $inputNotices = []; public static $inputNotices = [];
public static $importNotices = []; public static $importNotices = [];
public static $captchaNotices = [];
public static $coreNotices = []; public static $coreNotices = [];
public $output = [ public $output = [
'access' => true, 'access' => true,
@ -2710,10 +2711,6 @@ class layout extends common {
foreach (common::$coreNotices as $item) $notification .= $item . ' | '; foreach (common::$coreNotices as $item) $notification .= $item . ' | ';
$notificationClass = 'notificationError'; $notificationClass = 'notificationError';
} }
if(common::$inputNotices) {
$notification = 'Impossible de soumettre le formulaire, car il contient des erreurs';
$notificationClass = 'notificationError';
}
elseif(empty($_SESSION['ZWII_NOTIFICATION_SUCCESS']) === false) { elseif(empty($_SESSION['ZWII_NOTIFICATION_SUCCESS']) === false) {
$notification = $_SESSION['ZWII_NOTIFICATION_SUCCESS']; $notification = $_SESSION['ZWII_NOTIFICATION_SUCCESS'];
$notificationClass = 'notificationSuccess'; $notificationClass = 'notificationSuccess';

View File

@ -370,7 +370,7 @@ class user extends common {
} else { } else {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'notification' => 'Identifiant ou mot de passe incorrect' 'notification' => 'Identifiant ou mot de passe incorrects'
]); ]);
} }
/** /**
@ -391,6 +391,9 @@ class user extends common {
AND password_verify($this->getInput('userLoginPassword', helper::FILTER_STRING_SHORT, true), $this->getData(['user', $userId, 'password'])) AND password_verify($this->getInput('userLoginPassword', helper::FILTER_STRING_SHORT, true), $this->getData(['user', $userId, 'password']))
AND $this->getData(['user', $userId, 'group']) >= self::GROUP_MEMBER AND $this->getData(['user', $userId, 'group']) >= self::GROUP_MEMBER
) { ) {
// RAZ
$this->setData(['user',$userId,'connectFail',0 ]);
$this->setData(['user',$userId,'connectTimeout',0 ]);
// Expiration // Expiration
$expire = $this->getInput('userLoginLongTime') ? strtotime("+1 year") : 0; $expire = $this->getInput('userLoginLongTime') ? strtotime("+1 year") : 0;
$c = $this->getInput('userLoginLongTime', helper::FILTER_BOOLEAN) === true ? 'true' : 'false'; $c = $this->getInput('userLoginLongTime', helper::FILTER_BOOLEAN) === true ? 'true' : 'false';
@ -419,7 +422,7 @@ class user extends common {
} }
// Sinon notification d'échec // Sinon notification d'échec
} else { } else {
$notification = 'Identifiant ou mot de passe incorrect'; $notification = 'Identifiant ou mot de passe incorrects';
// Cas 1 le nombre de connexions est inférieur aux tentatives autorisées : incrément compteur d'échec // 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'])) { if ($this->getData(['user',$userId,'connectFail']) < $this->getData(['config', 'connect', 'attempt'])) {
$this->setData(['user',$userId,'connectFail',$this->getdata(['user',$userId,'connectFail']) + 1 ]); $this->setData(['user',$userId,'connectFail',$this->getdata(['user',$userId,'connectFail']) + 1 ]);