[9.0.04] Captcha et mail de groupe vide

This commit is contained in:
fredtempez 2019-03-10 10:26:12 +01:00
parent 3ad6fb5b04
commit cfca073208

View File

@ -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
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;