Browse Source

[9.0.04] Captcha et mail de groupe vide

pull/5/head
fredtempez 3 years ago
parent
commit
cfca073208
  1. 24
      module/form/form.php

24
module/form/form.php

@ -32,7 +32,7 @@ class form extends common {
public static $pagination;
const FORM_VERSION = '1.4';
const FORM_VERSION = '1.5';
const TYPE_MAIL = 'mail';
const TYPE_SELECT = 'select';
@ -279,6 +279,7 @@ class form extends common {
AND $this->getInput('formCapcha', helper::FILTER_INT) !== $this->getInput('formCapchaFirstNumber', helper::FILTER_INT) + $this->getInput('formCapchaSecondNumber', helper::FILTER_INT))
{
self::$inputNotices['formCapcha'] = 'Incorrect';
}
// Préparation le contenu du mail
$data = [];
@ -318,19 +319,20 @@ class form extends common {
$singlemail = $this->getData(['module', $this->getUrl(0), 'config', 'mail']);
// Verification si le mail peut être envoyé
if(
self::$inputNotices === []
AND $group = $this->getData(['module', $this->getUrl(0), 'config', 'group'])
OR $singleuser !== ''
OR $singlemail !== ''
self::$inputNotices === [] && (
$group = $this->getData(['module', $this->getUrl(0), 'config', 'group']) ||
$singleuser !== '' ||
$singlemail !== '' )
) {
// Utilisateurs dans le groupe
$to = [];
foreach($this->getData(['user']) as $userId => $user) {
if($user['group'] === $group) {
$to[] = $user['mail'];
if (!empty($user)){
$to = [];
foreach($this->getData(['user']) as $userId => $user) {
if($user['group'] === $group) {
$to[] = $user['mail'];
}
}
}
}
// Utilisateur désigné
if (!empty($singleuser)) {
$to[] = $singleuser;

Loading…
Cancel
Save