- Signal bug send to OTRS and not trackers. -Car
- New CSV-Importer -FRU
+ * Emails:
+ - New spam submission form -FRU
+
* Events:
- Tips. -FRU/Car
- Split Events in 2 modules: events and newsletter -FRU
'emails/broken' => $this->make_hook('broken', AUTH_COOKIE),
'emails/redirect' => $this->make_hook('redirect', AUTH_MDP),
'emails/send' => $this->make_hook('send', AUTH_MDP),
+ 'emails/antispam/submit' => $this->make_hook('submit', AUTH_COOKIE),
'admin/emails/duplicated' => $this->make_hook('duplicated', AUTH_MDP, 'admin')
);
$page->assign('filtre',$bogo->level());
}
+ function handler_submit(&$page)
+ {
+ $page->changeTpl('emails/submit_spam.tpl');
+
+ if (Post::has('send_email')) {
+ $upload = $_FILES['mail']['tmp_name'];
+ if (!is_uploaded_file($upload)) {
+ $page->trig('Une erreur a été rencontrée lors du transfert du fichier');
+ return;
+ }
+ $mime = mime_content_type($upload);
+ if ($mime != 'text/x-mail' && $mime != 'message/rfc822') {
+ $page->trig('Le fichier ne contient pas un mail complet');
+ return;
+ }
+ global $globals;
+ $box = Post::v('type') . '@' . $globals->mail->domain;
+ $mailer = new PlMailer();
+ $mailer->addTo($box);
+ $mailer->setFrom('"' . S::v('prenom') . ' ' . S::v('nom') . '" <web@' . $globals->mail->domain . '>');
+ $mailer->setTxtBody(Post::v('type') . ' soumis par ' . S::v('forlife') . ' via le web');
+ $mailer->addAttachment($upload, 'message/rfc822', $_FILES['mail']['name']);
+ $mailer->send();
+ $page->trig('Le message a été transmis à ' . $box);
+ }
+ }
+
function handler_send(&$page)
{
global $globals;
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2006 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<h1>Soumettre un spam</h1>
+
+<p>Ce formulaire permet de soumettre à l'antispam les mails mal filtrés.</p>
+
+<form method="post" action="{$platal->pl_self()}" enctype="multipart/form-data">
+ <table class="tinybicol">
+ <tr>
+ <td>
+ Soumettre un
+ <select name="type">
+ <option value="spam" {if $smarty.request.type neq 'spam'}selected="selected"{/if}>spam</option>
+ <option value="nonspam" {if $smarty.request.type eq 'nonspam'}selected="selected"{/if}>non-spam</option>
+ </select>
+ mal filtré.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type="file" name="mail" />
+ </td>
+ </tr>
+ </table>
+
+ <p class="center">
+ <input type="submit" name="send_email" value="Envoyer" />
+ </p>
+</form>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
<div class="menu_item"><a href="banana/">Forums & PA</a></div>
<div class="menu_item"><a href="lists">Listes de diffusion</a></div>
<div class="menu_item"><a href="payment">Télépaiements</a></div>
+<div class="menu_item"><a href="emails/antispam/submit">Soumettre un spam</a></div>
<div class="menu_item"><a href="emails/broken">Patte cassée</a></div>
<div class="menu_title">Communauté X</div>