if (!$core->hasRole('manager') | !$core->hasPermission('administration')) {
     __error(T_("Permission denied"), T_('You are not allowed to see this page.') . ' ' . T_('You can delete your session if you logout : ') . '<a href="?logout">Logout</a>');
     exit;
 }
 ### Mise en cache
 #debutCache();
 ### Initialisation variables de traitement
 $flash = array();
 # Tableau pour l'affichage des messages d'erreurs, d'avertissement, de notice, ...
 $confirmation = '';
 # Message de confirmation
 ### Initialisation des variables formulaires
 # Adresse e-mail expéditrice
 $sender = isset($_POST['newsletter_sender']) ? check_field(T_('Sender'), $_POST['newsletter_sender'], 'email') : check_field(T_('Sender'), $blog_settings->get('author_mail'), 'email');
 # Adresses e-mail destinataires
 $recipients = isset($_POST['newsletter_recipient']) ? check_recipients(T_('Recipients'), $_POST['newsletter_recipient']) : check_recipients(T_('Recipients'), '');
 # Sujet de la newsletter
 $subject = isset($_POST['newsletter_subject']) ? check_field(T_('Subject'), cleanupString($_POST['newsletter_subject']), 'not_empty') : '';
 # Contenu de la newsletter
 $message = isset($_POST['newsletter_message']) ? check_field(T_('Message'), cleanupString($_POST['newsletter_message']), 'not_empty') : '';
 ### On verifie que le formulaire est bien saisie
 if (isset($_POST) && isset($_POST['submitNewsletter'])) {
     if ($sender['success'] && $recipients['success'] && $subject['success'] && $message['success']) {
         $msg = htmlspecialchars(preg_replace('/\\n/', '<br/>', $message['value']));
         $confirmation .= '<p>';
         $confirmation .= '<form name="NewsletterConfirm" method="POST">';
         $confirmation .= '&nbsp;&nbsp;<u>' . T_('Are you sure you want to send this newsletter?') . '</u>';
         $confirmation .= '<br /><br />';
         $confirmation .= '<input type="hidden" name="sender" value="' . htmlspecialchars($sender['value']) . '" />';
         $confirmation .= '<input type="hidden" name="recipients" value="' . htmlspecialchars($recipients['value']) . '" />';
         $confirmation .= '<input type="hidden" name="subject" value="' . htmlspecialchars($subject['value']) . '" />';
Exemplo n.º 2
0
     $in_array_func = 'fake_in_array';
 }
 alias_fields();
 if (CHECK_REFERER == true) {
     check_referer($referers);
 } else {
     error_log('[PHPFormMail] HTTP_REFERER checking is turned off.  Referer: ' . getenv('HTTP_REFERER') . '; Client IP: ' . getenv('REMOTE_ADDR') . ';', 0);
 }
 if (isset($form['recipient'])) {
     check_recipients($recipients, $form['recipient']);
 }
 if (isset($form['recipient_cc'])) {
     check_recipients($recipients, $form['recipient_cc']);
 }
 if (isset($form['recipient_bcc'])) {
     check_recipients($recipients, $form['recipient_bcc']);
 }
 check_required();
 if (!$errors) {
     if (!isset($form['subject'])) {
         $form['subject'] = '';
     }
     if (!isset($form['email'])) {
         $form['email'] = '*****@*****.**';
     }
     if (!isset($form['mail_newline'])) {
         $form['mail_newline'] = 1;
     }
     if (isset($form['sort'])) {
         sort_fields();
     }