From 58f98c20e8961ea63690c7bcc9fcfd0ea0c174e6 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Sat, 25 Sep 2004 16:30:24 +0000 Subject: [PATCH] cosmetic + sql for lists + list of all lists for admins --- htdocs/admin/{gerer_listes.php => lists.php} | 22 +++++++------- htdocs/listes/index.php | 2 +- scripts/migration.sql | 3 +- templates/admin/index.tpl | 14 ++++----- templates/admin/lists.tpl | 43 ++++++++++++++++++++++++++++ templates/listes/index.tpl | 15 +++++++--- templates/listes/listes.inc.tpl | 9 ++++-- 7 files changed, 81 insertions(+), 27 deletions(-) rename htdocs/admin/{gerer_listes.php => lists.php} (75%) create mode 100644 templates/admin/lists.tpl diff --git a/htdocs/admin/gerer_listes.php b/htdocs/admin/lists.php similarity index 75% rename from htdocs/admin/gerer_listes.php rename to htdocs/admin/lists.php index 6386950..80f5c33 100644 --- a/htdocs/admin/gerer_listes.php +++ b/htdocs/admin/lists.php @@ -18,19 +18,19 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: gerer_listes.php,v 1.2 2004-08-31 10:03:29 x2000habouzit Exp $ + $Id: lists.php,v 1.1 2004-09-25 16:30:25 x2000habouzit Exp $ ***************************************************************************/ -require('auto.prepend.inc.php'); -new_admin_table_editor('listes_def','id'); +require("auto.prepend.inc.php"); +new_admin_page('admin/lists.tpl'); +include('xml-rpc-client.inc.php'); -$editor->add_join_table('aliases','id','aliases.type=\'liste\''); +$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); -$editor->add_join_field('aliases','alias','alias','','liste',true); -$editor->describe('topic','topic',true); -$editor->describe('type','type',true,'set'); - -$editor->assign('title', 'Gestion des liste des diffusion'); - -$editor->run(); +$client = new xmlrpc_client("http://{$_SESSION['uid']}:$pass@localhost:4949"); +$listes = $client->get_lists('polytechnique.org'); +$page->assign_by_ref('listes',$listes); +$page->run(); ?> diff --git a/htdocs/listes/index.php b/htdocs/listes/index.php index b459d0f..24fe600 100644 --- a/htdocs/listes/index.php +++ b/htdocs/listes/index.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: index.php,v 1.5 2004-09-25 14:56:53 x2000habouzit Exp $ + $Id: index.php,v 1.6 2004-09-25 16:30:25 x2000habouzit Exp $ ***************************************************************************/ require("auto.prepend.inc.php"); diff --git a/scripts/migration.sql b/scripts/migration.sql index 4613b97..5612a32 100644 --- a/scripts/migration.sql +++ b/scripts/migration.sql @@ -29,7 +29,8 @@ ALTER TABLE x4dat.auth_user_md5 DROP COLUMN prenom_soundex; ALTER TABLE x4dat.auth_user_md5 DROP COLUMN epouse_soundex; -- drop des anciens alias --> aliases alter table x4dat.aliases add column expire date; -ALTER TABLE x$dat.aliases CHANGE `type` `type` ENUM( 'a_vie', 'epouse', 'alias', 'homonyme', 'liste', 'liste-owner', 'liste-request', 'liste-sans-moderation' ) DEFAULT 'alias' NOT NULL +ALTER TABLE x4dat.aliases CHANGE `type` `type` ENUM( 'a_vie', 'epouse', 'alias', 'homonyme', 'liste' ) DEFAULT 'alias' NOT NULL +delete from x4dat.aliases where type=''; -- auth_user_md5 update x4dat.aliases as a inner join x4dat.auth_user_md5 as u ON(u.loginbis=a.alias) diff --git a/templates/admin/index.tpl b/templates/admin/index.tpl index 6848d1a..683947b 100644 --- a/templates/admin/index.tpl +++ b/templates/admin/index.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: index.tpl,v 1.6 2004-08-31 11:25:39 x2000habouzit Exp $ + $Id: index.tpl,v 1.7 2004-09-25 16:30:26 x2000habouzit Exp $ ***************************************************************************} @@ -38,7 +38,7 @@ Webalizer - Sécurité : + Sécurité : Logs des sessions   |   Actions @@ -57,7 +57,7 @@ Infos dynamiques : Coupures   |   - Événements + événements Champs profil : @@ -68,23 +68,23 @@ Newsletter : - Préparation   |   + Préparation   |   Archives   |   Adresses en panne Administrer : Auth Groupes X  |   - Listes + Listes Valider demandes : Valider   |   - Événements + événements - Trésorerie : + Trésorerie : Comptes   |   Paiements diff --git a/templates/admin/lists.tpl b/templates/admin/lists.tpl new file mode 100644 index 0000000..01546f6 --- /dev/null +++ b/templates/admin/lists.tpl @@ -0,0 +1,43 @@ +{*************************************************************************** + * Copyright (C) 2003-2004 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 * + *************************************************************************** + $Id: lists.tpl,v 1.1 2004-09-25 16:30:26 x2000habouzit Exp $ + ***************************************************************************} + + +
+ Mail Lists +
+ + + + + + + + {foreach from=$listes item=l} + + + + + + {/foreach} +
ListesSujetNb
{$l.list}{$l.desc}{$l.nbsub}
+ +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/listes/index.tpl b/templates/listes/index.tpl index 1929118..8653e50 100644 --- a/templates/listes/index.tpl +++ b/templates/listes/index.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: index.tpl,v 1.8 2004-09-25 15:55:26 x2000habouzit Exp $ + $Id: index.tpl,v 1.9 2004-09-25 16:30:26 x2000habouzit Exp $ ***************************************************************************}
@@ -49,9 +49,16 @@ Pour se d La diffusion sur une liste de diffusion

-Certaines listes sont à diffusion modérée, l'envoi d'un mail à la liste est alors filtré par des -modérateurs : eux seuls peuvent accepter un message envoyé à la liste. Pour les autres listes, la -diffusion est immédiate. +La diffusion a trois niveaux de modération. La diffusion peut être : +

+

NB : les gestionnaires d'une liste sont aussi ses modérateurs. diff --git a/templates/listes/listes.inc.tpl b/templates/listes/listes.inc.tpl index c9d10d3..13b6588 100644 --- a/templates/listes/listes.inc.tpl +++ b/templates/listes/listes.inc.tpl @@ -17,14 +17,15 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: listes.inc.tpl,v 1.7 2004-09-25 15:55:26 x2000habouzit Exp $ + $Id: listes.inc.tpl,v 1.8 2004-09-25 16:30:26 x2000habouzit Exp $ ***************************************************************************} - + + @@ -41,7 +42,9 @@ + -- 2.1.4
Liste DescriptionRégulationDiff.Inscr. Nb
{$liste.desc} - {if $liste.diff eq 2}2{elseif $list.diff}1{else}0{/if} + {if $liste.diff eq 2}modérée{elseif $liste.diff}restreinte{else}libre{/if} + {if $liste.ins}modérée{else}libre{/if} {$liste.nbsub}