[10.0.37.dev] empêche l'envoi d'un mail si captcha incorrect

This commit is contained in:
fredtempez 2019-10-19 19:57:49 +02:00
parent 5d880fa2da
commit 2f9f61c5a3
2 changed files with 49 additions and 47 deletions

View File

@ -31,7 +31,7 @@ class common {
const TEMP_DIR = 'site/tmp/';
// Numéro de version
const ZWII_VERSION = '10.0.36.dev';
const ZWII_VERSION = '10.0.37.dev';
public static $actions = [];
public static $coreModuleIds = [

View File

@ -293,6 +293,7 @@ class form extends common {
// Préparation le contenu du mail
$data = [];
$content = '';
$sent = false;
foreach($this->getData(['module', $this->getUrl(0), 'input']) as $index => $input) {
// Filtre la valeur
switch($input['type']) {
@ -318,10 +319,10 @@ class form extends common {
$content .= '<strong>' . $this->getData(['module', $this->getUrl(0), 'input', $index, 'name']) . ' :</strong> ' . $value . '<br>';
}
// Crée les données
$this->setData(['module', $this->getUrl(0), 'data', helper::increment(1, $this->getData(['module', $this->getUrl(0), 'data'])), $data]);
$success = $this->setData(['module', $this->getUrl(0), 'data', helper::increment(1, $this->getData(['module', $this->getUrl(0), 'data'])), $data]);
// Envoi du mail
if ($success === true) {
// Rechercher l'adresse en fonction du mail
$sent = true;
$singleuser = $this->getData(['user',
$this->getData(['module', $this->getUrl(0), 'config', 'user']),
'mail']);
@ -369,6 +370,7 @@ class form extends common {
);
}
}
}
// Redirection
$redirect = $this->getData(['module', $this->getUrl(0), 'config', 'pageId']);
// Valeurs en sortie