From 136c9ed71da5598c7be7cb5181104cb2504c8231 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Mon, 6 Jan 2025 22:32:49 +0100 Subject: [PATCH] 13.5.02 bug reset --- CHANGES.md | 6 +++++- core/core.php | 2 +- core/module/user/user.php | 11 ++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7e662a75..0b08e983 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,11 @@ # Notes de mises à jour +## Version 13.5.02 +**Correction** +- La réinitialisation du mot de passe ne fonctionnait pas. L'échec du changement de mot de passe est enregistré dans les journal de Zwii. + ## Version 13.5.01 -**Corrections** +**Correction** - Configuration du site, le message de formulaire non soumis non affiché. ## Version 13.5.00 diff --git a/core/core.php b/core/core.php index 41f98699..ff5bb9cf 100644 --- a/core/core.php +++ b/core/core.php @@ -51,7 +51,7 @@ class common const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '13.5.01'; + const ZWII_VERSION = '13.5.02'; // URL autoupdate const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/cms-update/raw/branch/master/'; diff --git a/core/module/user/user.php b/core/module/user/user.php index 3fbff647..7fd4d919 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -1289,11 +1289,16 @@ class user extends common // L'utilisateur n'existe pas $this->getData(['user', $this->getUrl(2)]) === null // Lien de réinitialisation trop vieux - or $this->getData(['user', $this->getUrl(2), 'forgot']) + 86400 < time() + || $this->getData(['user', $this->getUrl(2), 'forgot']) + 86400 < time() // Id unique incorrecte - or $this->getUrl(3) !== md5(json_encode($this->getData(['user', $this->getUrl(2)]))) + || $this->getUrl(3) !== md5(json_encode($this->getData(['user', $this->getUrl(2), 'logout']))) ) { - + $this->saveLog( + ' Erreur de réinitialisation de mot de passe ' . $this->getUrl(2) . + ' Compte : ' . $this->getData(['user', $this->getUrl(2)]) . + ' Temps : ' . $this->getData(['user', $this->getUrl(2), 'forgot']) + 86400 < time() . + ' Clé : ' . $this->getUrl(3) !== md5(json_encode($this->getData(['user', $this->getUrl(2), 'forgot']))) + ); // Valeurs en sortie $this->addOutput([ 'redirect' => helper::baseurl(),