Bugs getUser getUrl

This commit is contained in:
Fred Tempez 2025-02-12 10:37:54 +01:00
parent 62d4954572
commit 1f91f501d5
2 changed files with 7 additions and 7 deletions

View File

@ -641,7 +641,7 @@ class common
/**
* Ecrire les données de la page
* @param string pageId
* @param array contenu de la page
* @param string contenu de la page
* @return int nombre d'octets écrits ou erreur
*/
public function setPage($page, $value, $path)
@ -1663,7 +1663,7 @@ function makeThumb($src, $dest, $desired_width)
}
return $filter;
default:
return null;
return [];
}
}

View File

@ -209,7 +209,7 @@ class user extends common
// L'utilisateur n'existe pas
$this->getData(['user', $this->getUrl(2)]) === null
// Groupe insuffisant
and ($this->getUrl('role') < self::ROLE_EDITOR)
and ($this->getUser('role') < self::ROLE_EDITOR)
) {
// Valeurs en sortie
$this->addOutput([
@ -411,10 +411,10 @@ class user extends common
and (
// Impossible de s'auto-éditer
($this->getUser('id') === $this->getUrl(2)
and $this->getUrl('role') <= self::ROLE_VISITOR
and $this->getUser('role') <= self::ROLE_VISITOR
)
// Impossible d'éditer un autre utilisateur
or ($this->getUrl('role') < self::ROLE_EDITOR)
or ($this->getUser('role') < self::ROLE_EDITOR)
)
) {
// Valeurs en sortie
@ -1423,8 +1423,8 @@ class user extends common
$notification = helper::translate('Captcha, identifiant ou mot de passe incorrects');
$logStatus = $captcha === true ? helper::translate('Erreur de mot de passe') : helper::translate('Erreur de captcha');
// 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'], false)) {
$this->setData(['user', $userId, 'connectFail', $this->getdata(['user', $userId, 'connectFail']) + 1], false);
if ($this->getData(['user', $userId, 'connectFail']) < $this->getData(['config', 'connect', 'attempt'])) {
$this->setData(['user', $userId, 'connectFail', $this->getdata(['user', $userId, 'connectFail']) + 1]);
}
// Cas 2 la limite du nombre de connexion est atteinte : placer le timer
if ($this->getdata(['user', $userId, 'connectFail']) == $this->getData(['config', 'connect', 'attempt'])) {