forked from ZwiiCMS-Team/ZwiiCMS
Corrections module
This commit is contained in:
parent
97477ff734
commit
b080d81312
@ -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
|
||||
]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user