From: x2000habouzit now have title (closes: FS#99). -MC
diff --git a/htdocs/listes/admin.php b/htdocs/listes/admin.php
index 7adf3b6..2bd6221 100644
--- a/htdocs/listes/admin.php
+++ b/htdocs/listes/admin.php
@@ -18,7 +18,7 @@
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: admin.php,v 1.6 2004-10-23 21:31:46 x2000habouzit Exp $
+ $Id: admin.php,v 1.7 2004-10-24 13:49:02 x2000habouzit Exp $
***************************************************************************/
if(empty($_REQUEST['liste'])) header('Location: index.php');
@@ -31,11 +31,16 @@ include('xml-rpc-client.inc.php');
$res = $globals->db->query("SELECT password FROM auth_user_md5 WHERE user_id={$_SESSION['uid']}");
list($pass) = mysql_fetch_row($res);
mysql_free_result($res);
+
+$err = Array();
$client = new xmlrpc_client("http://{$_SESSION['uid']}:$pass@localhost:4949");
if(isset($_REQUEST['add_member'])) {
- $client->mass_subscribe('polytechnique.org', $liste, Array($_REQUEST['add_member']));
+ $arr = $client->mass_subscribe('polytechnique.org', $liste, Array($_REQUEST['add_member']));
+ if(is_array($arr)) {
+ foreach($arr as $addr) $err[] = "{$addr[0]} inscrit.";
+ }
}
if(isset($_REQUEST['del_member'])) {
@@ -44,7 +49,8 @@ if(isset($_REQUEST['del_member'])) {
}
if(isset($_REQUEST['add_owner'])) {
- $client->add_owner('polytechnique.org', $liste, $_REQUEST['add_owner']);
+ if($client->add_owner('polytechnique.org', $liste, $_REQUEST['add_owner']))
+ $err = $_REQUEST['add_owner']." ajouté aux modérateurs.";
}
if(isset($_REQUEST['del_owner'])) {
@@ -89,5 +95,6 @@ if(list($det,$mem,$own) = $client->get_members('polytechnique.org', $liste)) {
} else
$page->assign('no_list',true);
+$page->assign('err', $err);
$page->run();
?>
diff --git a/htdocs/listes/moderate.php b/htdocs/listes/moderate.php
index 78c799c..86933f9 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.9 2004-10-24 12:54:44 x2000habouzit Exp $
+ $Id: moderate.php,v 1.10 2004-10-24 13:49:02 x2000habouzit Exp $
***************************************************************************/
if(empty($_REQUEST['liste'])) header('Location: index.php');
@@ -48,14 +48,15 @@ if(isset($_POST['sdel'])) {
/** 2 is the magic for REJECT see Defaults.py **/
}
-if(isset($_POST['mid'])) {
- include_once('diogenes.mailer.inc.php');
- $mid = $_POST['mid'];
- if(isset($_POST['mok'])) {
+if(isset($_REQUEST['mid'])) {
+ $mid = $_REQUEST['mid'];
+ if(isset($_REQUEST['mok'])) {
+ unset($_GET['mid']);
$client->handle_request('polytechnique.org', $liste,$mid,1,''); /** 1 = APPROVE **/
} elseif(isset($_POST['mno'])) {
$reason = stripslashes($_POST['reason']);
if($client->handle_request('polytechnique.org', $liste,$mid,2,$reason)) { /** 2 = REJECT **/
+ include_once('diogenes.mailer.inc.php');
$mailer = new DiogenesMailer("$liste-bounces@polytechnique.org",
"$liste-owner@polytechnique.org", "Message refusé");
$texte = "le message a été refusé par {$_SESSION['prenom']} {$_SESSION['nom']} avec la raison :\n"
@@ -63,8 +64,10 @@ if(isset($_POST['mid'])) {
$mailer->setBody(wordwrap($texte,72));
$mailer->send();
}
- } elseif(isset($_POST['mdel'])) {
+ } elseif(isset($_REQUEST['mdel'])) {
+ unset($_GET['mid']);
if($client->handle_request('polytechnique.org', $liste,$mid,3,'')) { /** 3 = DISCARD **/
+ include_once('diogenes.mailer.inc.php');
$mailer = new DiogenesMailer("$liste-bounces@polytechnique.org",
"$liste-owner@polytechnique.org", "Message supprimé");
$texte = "le message a été supprimé par {$_SESSION['prenom']} {$_SESSION['nom']}.\n\n"
@@ -76,6 +79,7 @@ if(isset($_POST['mid'])) {
}
if(isset($_REQUEST['sid'])) {
+
$sid = $_REQUEST['sid'];
if(list($subs,$mails) = $client->get_pending_ops('polytechnique.org', $liste)) {
foreach($subs as $user) {
diff --git a/templates/listes/admin.tpl b/templates/listes/admin.tpl
index 432d569..1ba3b9f 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.11 2004-10-23 21:33:40 x2000habouzit Exp $
+ $Id: admin.tpl,v 1.12 2004-10-24 13:49:03 x2000habouzit Exp $
***************************************************************************}
{dynamic}
@@ -55,6 +55,10 @@ Pour entrer un utilisateur, il faut remplir les champs pr
c'est-à-dire "prenom.nom" ou "prenom.nom.promo"
{$e}
+{/foreach} +émetteur | @@ -87,12 +102,13 @@ {foreach from=$mails item=m}|||||
---|---|---|---|---|---|
{$m.sender} | -{$m.subj} | +{$m.subj|default:"[pas de sujet]"} | {$m.size}o | {$m.stamp|date_format:"%H:%M:%S %d %b %Y"} |
voir - | + accepter