From b36a0f069f4cab04b9a8d43fc5501aaa93988884 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 8 Sep 2020 21:25:42 +0200 Subject: [PATCH] =?UTF-8?q?Bug=20masque=20installation=20valid=C3=A9=20vid?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/install/install.php | 34 +++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/core/module/install/install.php b/core/module/install/install.php index 5d46267f..7d03bfe9 100644 --- a/core/module/install/install.php +++ b/core/module/install/install.php @@ -72,18 +72,27 @@ class install extends common { $this->setData(['module', 'blog', 'mon-deuxieme-article', 'userId', $userId]); $this->setData(['module', 'blog', 'mon-troisieme-article', 'userId', $userId]); } - $success = $this->setData([ - 'user', - $userId, - [ - 'firstname' => $userFirstname, - 'forgot' => 0, - 'group' => self::GROUP_ADMIN, - 'lastname' => $userLastname, - 'mail' => $userMail, - 'password' => $this->getInput('installPassword', helper::FILTER_PASSWORD, true) - ] - ]); + // Création de l'utilisateur si les données sont complétées. + $success = false; + if ( $userFirstname + AND $userLastname + AND $userMail + AND $this->getInput('installPassword', helper::FILTER_PASSWORD, true) + AND $this->getInput('installConfirmPassword', helper::FILTER_STRING_SHORT, true) + ){ + $success = $this->setData([ + 'user', + $userId, + [ + 'firstname' => $userFirstname, + 'forgot' => 0, + 'group' => self::GROUP_ADMIN, + 'lastname' => $userLastname, + 'mail' => $userMail, + 'password' => $this->getInput('installPassword', helper::FILTER_PASSWORD, true) + ] + ]); + } if ($success === true) { // Formulaire complété envoi du mail // Envoie le mail $sent = $this->sendMail( @@ -102,6 +111,7 @@ class install extends common { // Créer sitemap $this->createSitemap(); // Valeurs en sortie + echo helper::baseUrl(false); $this->addOutput([ 'redirect' => helper::baseUrl(false), 'notification' => ($sent === true ? 'Installation terminée' : $sent),