/** * protected var for dbLayer * * @var void */ function __construct() { if (class_exists('backend_model_message')) { $this->message = new backend_model_message(); } if (magixcjquery_filter_request::isPost('passwd_admin')) { $this->passwd_admin = sha1(magixcjquery_form_helpersforms::inputClean($_POST['passwd_admin'])); } if (magixcjquery_filter_request::isPost('hashtoken')) { $this->hashtoken = magixcjquery_filter_var::escapeHTML($_POST['hashtoken']); } if (magixcjquery_filter_request::isGet('logout')) { $this->logout = magixcjquery_filter_isVar::isPostAlpha($_GET['logout']); } if (magixcjquery_filter_request::isPost('email_admin')) { $this->email_admin = magixcjquery_filter_isVar::isMail($_POST['email_admin']); } //LOSTPASSWORD if (magixcjquery_filter_request::isPost('lo_email_admin')) { $this->lo_email_admin = magixcjquery_filter_isVar::isMail($_POST['lo_email_admin']); } }
/** * Envoi du mail * Si return true retourne success.tpl * sinon retourne empty.tpl */ protected function send_email($create) { if (isset($this->email)) { $create->configLoad(); if (empty($this->lastname) or empty($this->firstname) or empty($this->email)) { $this->getNotify('warning', 'empty'); } elseif (!magixcjquery_filter_isVar::isMail($this->email)) { $this->getNotify('warning', 'mail'); } elseif (!empty($this->moreinfo)) { $this->getNotify('error', 'configured'); } else { if ($create->getLanguage()) { if (parent::c_show_table() != 0) { if (parent::s_contact($create->getLanguage()) != null) { //Instance la classe mail avec le paramètre de transport $core_mail = new magixglobal_model_mail('mail'); //Charge dans un tableau les utilisateurs qui reçoivent les mails $lotsOfRecipients = parent::s_contact($create->getLanguage()); //Initialisation du contenu du message foreach ($lotsOfRecipients as $recipient) { $message = $core_mail->body_mail(self::setTitleMail(), array($this->email), array($recipient['mail_contact']), self::getBodyMail(), false); $core_mail->batch_send_mail($message); } $this->getNotify('success'); } else { $this->getNotify('error', 'configured'); } } else { $this->getNotify('error', 'installed'); } } } } }