From b080d813121679c3a0a6289c0b7bb828a358d281 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 19 Dec 2020 22:46:16 +0100 Subject: [PATCH] Corrections module --- module/registration/registration.php | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/module/registration/registration.php b/module/registration/registration.php index 6dba0e80..899cebbd 100755 --- a/module/registration/registration.php +++ b/module/registration/registration.php @@ -226,10 +226,6 @@ class registration extends common { break; } } - // Le compte existe déjà - if ($this->getData(['user',$userId])) { - $check = false; - } // Données de l'utilisateur $userFirstname = $this->getInput('registrationAddFirstname', helper::FILTER_STRING_SHORT, true); $userLastname = $this->getInput('registrationAddLastname', helper::FILTER_STRING_SHORT, true); @@ -319,18 +315,14 @@ class registration extends common { */ public function validate() { // Vérifie la session + l'id + le timer - $check= true; + $check = true; $notification = 'Bienvenue sur le site' . $this->getData(['config', 'title']) ; $csrf = $this->getUrl(3); $userId = $this->getUrl(2); - // Le compte existe déjà - if ($this->getData(['user',$userId]) - OR $userId == NULL) { - $check = false; - } + // Validité if ( time() - $this->getData(['user',$userId,'timer']) <= (60 * $this->getdata(['module','registration',$this->getUrl(0),'config','pageTimeOut'])) ) { $check = false; - $notidication = 'Le lien n\'est plus valide'; + $notification = 'Le lien n\'est plus valide'; } if (( $csrf !== $this->getData(['user',$userId,'auth']) ) ) { $check = false; @@ -354,8 +346,8 @@ class registration extends common { // Valeurs en sortie $this->addOutput([ 'redirect' => $check ? helper::baseUrl() . $this->getdata(['module','registration',$this->getUrl(0),'config','pageSuccess']) : helper::baseUrl() . $this->getdata(['module','registration',$this->getUrl(0),'config','pageError']) , - /*'notification' => $notification, - 'state' => $check*/ + 'notificaton' => $notification, + 'state' => $check ]); }