From: x2003bruneau Date: Sun, 24 Dec 2006 11:13:29 +0000 (+0000) Subject: New spam submission form X-Git-Tag: xorg/0.9.13~155 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=62ce63564d487017774014ae0c2ac5fac347dbb8;p=platal.git New spam submission form git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1313 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/ChangeLog b/ChangeLog index c1fdbd1..b3b2b05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,9 @@ New: - 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 diff --git a/modules/email.php b/modules/email.php index 6d690eb..c053cfb 100644 --- a/modules/email.php +++ b/modules/email.php @@ -30,6 +30,7 @@ class EmailModule extends PLModule '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') ); @@ -263,6 +264,33 @@ class EmailModule extends PLModule $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') . '" 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; diff --git a/templates/emails/submit_spam.tpl b/templates/emails/submit_spam.tpl new file mode 100644 index 0000000..dd44780 --- /dev/null +++ b/templates/emails/submit_spam.tpl @@ -0,0 +1,51 @@ +{**************************************************************************} +{* *} +{* 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 *} +{* *} +{**************************************************************************} + +

Soumettre un spam

+ +

Ce formulaire permet de soumettre à l'antispam les mails mal filtrés.

+ +
+ + + + + + + +
+ Soumettre un + + mal filtré. +
+ +
+ +

+ +

+
+ +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/skin/common.menu.tpl b/templates/skin/common.menu.tpl index 5066cdc..1904db5 100644 --- a/templates/skin/common.menu.tpl +++ b/templates/skin/common.menu.tpl @@ -57,6 +57,7 @@ +