From: x2000habouzit Date: Wed, 22 Sep 2004 11:39:51 +0000 (+0000) Subject: more improvements + mail moderation X-Git-Tag: xorg/old~1513 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=2d3f7bd108194e29452226670b1af5dd45228b47;p=platal.git more improvements + mail moderation I still want to give acces for administrators to more things about their ML, so admin.php will still have to evolve. but I guess the current impl match what was possible before --- diff --git a/htdocs/listes/moderate.php b/htdocs/listes/moderate.php index d29cc16..e152246 100644 --- a/htdocs/listes/moderate.php +++ b/htdocs/listes/moderate.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: moderate.php,v 1.2 2004-09-21 15:40:35 x2000habouzit Exp $ + $Id: moderate.php,v 1.3 2004-09-22 11:39:51 x2000habouzit Exp $ ***************************************************************************/ if(empty($_REQUEST['liste'])) header('Location: index.php'); @@ -42,6 +42,16 @@ if(isset($_POST['sdel'])) { $client->handle_request($liste,$_POST['sdel'],2,stripslashes($_POST['reason'])); /** 2 is the magic for REJECT see Defaults.py **/ } +if(isset($_POST['mid'])) { + $mid = $_POST['mid']; + if(isset($_POST['mok'])) + $client->handle_request($liste,$mid,1,''); /** 1 = APPROVE **/ + elseif(isset($_POST['mno'])) + $client->handle_request($liste,$mid,2,stripslashes($_POST['reason'])); /** 2 = REJECT **/ + elseif(isset($_POST['mdel'])) + $client->handle_request($liste,$mid,3,''); /** 3 = DISCARD **/ +} + if(isset($_REQUEST['sid'])) { $sid = $_REQUEST['sid']; if(list($subs,$mails) = $client->get_pending_ops($liste)) { @@ -58,14 +68,25 @@ if(isset($_REQUEST['sid'])) { $page->assign_by_ref('subs', $subs); $page->assign_by_ref('mails', $mails); } -} elseif(isset($_REQUEST['mid'])) { + +} elseif(isset($_GET['mid'])) { + $mid = $_REQUEST['mid']; - new_skinned_page('listes/moderate_mail.tpl', AUTH_MDP, true); $mail = $client->get_pending_mail($liste,$mid); if(is_array($mail)) { + new_skinned_page('listes/moderate_mail.tpl', AUTH_MDP, true); $page->assign_by_ref('mail', $mail); + } else { + new_skinned_page('listes/moderate.tpl', AUTH_MDP, true); + + if(list($subs,$mails) = $client->get_pending_ops($liste)) { + $page->assign_by_ref('subs', $subs); + $page->assign_by_ref('mails', $mails); + } } + } else { + new_skinned_page('listes/moderate.tpl', AUTH_MDP, true); if(list($subs,$mails) = $client->get_pending_ops($liste)) { @@ -73,5 +94,9 @@ if(isset($_REQUEST['sid'])) { $page->assign_by_ref('mails', $mails); } } + +function tolatin1($s) { return iconv('utf-8', 'iso-8859-1', $s); } +$page->register_modifier('tl1','tolatin1'); +$page->register_modifier('qpd','quoted_printable_decode'); $page->run(); ?> diff --git a/templates/listes/admin.tpl b/templates/listes/admin.tpl index 89a11ea..50dfbc7 100644 --- a/templates/listes/admin.tpl +++ b/templates/listes/admin.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: admin.tpl,v 1.1 2004-09-21 16:14:35 x2000habouzit Exp $ + $Id: admin.tpl,v 1.2 2004-09-22 11:39:51 x2000habouzit Exp $ ***************************************************************************} {dynamic} @@ -110,7 +110,7 @@
Administrer la liste
-{if $details.priv < 2} +{if $details.you < 2}

Tu n'es pas administrateur de la liste, mais du site.

diff --git a/templates/listes/moderate.tpl b/templates/listes/moderate.tpl index fe1b1b8..bbdd823 100644 --- a/templates/listes/moderate.tpl +++ b/templates/listes/moderate.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: moderate.tpl,v 1.4 2004-09-22 08:42:26 x2000habouzit Exp $ + $Id: moderate.tpl,v 1.5 2004-09-22 11:39:51 x2000habouzit Exp $ ***************************************************************************} {dynamic} @@ -74,8 +74,8 @@ {foreach from=$mails item=m} - {$m.sender} - {$m.subj} + {$m.sender|tl1} + {$m.subj|tl1} {$m.size}o {$m.stamp|date_format:"%H:%M:%S
%d %b %Y"} diff --git a/templates/listes/moderate_mail.tpl b/templates/listes/moderate_mail.tpl index 803976a..9af0e63 100644 --- a/templates/listes/moderate_mail.tpl +++ b/templates/listes/moderate_mail.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: moderate_mail.tpl,v 1.2 2004-09-21 15:40:36 x2000habouzit Exp $ + $Id: moderate_mail.tpl,v 1.3 2004-09-22 11:39:51 x2000habouzit Exp $ ***************************************************************************} {dynamic} @@ -35,11 +35,11 @@ - + - + @@ -60,12 +60,34 @@ {foreach from=$mail.parts item=part key=i} - + {/foreach}
émetteur{$mail.sender}{$mail.sender|tl1}
sujet{$mail.subj}{$mail.subj|tl1}
taille
Partie n°{$i}
{$part|regex_replace:"!\\n-- *\\n(.*?)$!sm":"

\\1"}
{$part|qpd|regex_replace:"!\\n-- *\\n(.*?)$!sm":"

\\1"}
+
{/if} +
+ + + + + + + + + + +
Modérer le mail de :
raison (pour les refus) : + +
+ +   +   + +
+
+ {/if} {/dynamic}