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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Le compte existe déjà
|
|
||||||
if ($this->getData(['user',$userId])) {
|
|
||||||
$check = false;
|
|
||||||
}
|
|
||||||
// Données de l'utilisateur
|
// Données de l'utilisateur
|
||||||
$userFirstname = $this->getInput('registrationAddFirstname', helper::FILTER_STRING_SHORT, true);
|
$userFirstname = $this->getInput('registrationAddFirstname', helper::FILTER_STRING_SHORT, true);
|
||||||
$userLastname = $this->getInput('registrationAddLastname', 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() {
|
public function validate() {
|
||||||
// Vérifie la session + l'id + le timer
|
// Vérifie la session + l'id + le timer
|
||||||
$check= true;
|
$check = true;
|
||||||
$notification = 'Bienvenue sur le site' . $this->getData(['config', 'title']) ;
|
$notification = 'Bienvenue sur le site' . $this->getData(['config', 'title']) ;
|
||||||
$csrf = $this->getUrl(3);
|
$csrf = $this->getUrl(3);
|
||||||
$userId = $this->getUrl(2);
|
$userId = $this->getUrl(2);
|
||||||
// Le compte existe déjà
|
// Validité
|
||||||
if ($this->getData(['user',$userId])
|
|
||||||
OR $userId == NULL) {
|
|
||||||
$check = false;
|
|
||||||
}
|
|
||||||
if ( time() - $this->getData(['user',$userId,'timer']) <= (60 * $this->getdata(['module','registration',$this->getUrl(0),'config','pageTimeOut'])) ) {
|
if ( time() - $this->getData(['user',$userId,'timer']) <= (60 * $this->getdata(['module','registration',$this->getUrl(0),'config','pageTimeOut'])) ) {
|
||||||
$check = false;
|
$check = false;
|
||||||
$notidication = 'Le lien n\'est plus valide';
|
$notification = 'Le lien n\'est plus valide';
|
||||||
}
|
}
|
||||||
if (( $csrf !== $this->getData(['user',$userId,'auth']) ) ) {
|
if (( $csrf !== $this->getData(['user',$userId,'auth']) ) ) {
|
||||||
$check = false;
|
$check = false;
|
||||||
@ -354,8 +346,8 @@ class registration extends common {
|
|||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$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']) ,
|
'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,
|
'notificaton' => $notification,
|
||||||
'state' => $check*/
|
'state' => $check
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user