From ded7bb5c818fca52641d6b58aa208c1ddfa3a329 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sun, 4 Feb 2024 21:38:58 +0100 Subject: [PATCH] =?UTF-8?q?1.4.21=20evite=20une=20redirection=20vers=20une?= =?UTF-8?q?=20page=20d'erreur=20apr=C3=A8s=20login?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 2 +- core/module/user/user.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/core.php b/core/core.php index 5099da7..367cbe0 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 = '1.4.20'; + const ZWII_VERSION = '1.4.21'; // URL autoupdate const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/'; diff --git a/core/module/user/user.php b/core/module/user/user.php index cd7cce8..84f5ffb 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -1060,7 +1060,13 @@ class user extends common ]); } else { $logStatus = 'Connexion réussie'; - $redirect = ($this->getUrl(2) && strpos($this->getUrl(2), 'user_reset') !== 0) ? helper::baseUrl() . str_replace('_', '/', str_replace('__', '#', $this->getUrl(2))) : helper::baseUrl(); + $pageId = $this->getUrl(2); + if ($this->getData(['config', 'page404']) === $pageId + || $this->getData(['config', 'page403']) === $pageId + ) { + $pageId = ''; + } + $redirect = ($pageId && strpos($pageId, 'user_reset') !== 0) ? helper::baseUrl() . str_replace('_', '/', str_replace('__', '#', $pageId)) : helper::baseUrl(); // Valeurs en sortie $this->addOutput([ 'notification' => sprintf(helper::translate('Bienvenue %s %s'), $this->getData(['user', $userId, 'firstname']), $this->getData(['user', $userId, 'lastname'])),