cosmetic + sql for lists + list of all lists for admins
authorx2000habouzit <x2000habouzit>
Sat, 25 Sep 2004 16:30:24 +0000 (16:30 +0000)
committerx2000habouzit <x2000habouzit>
Sat, 25 Sep 2004 16:30:24 +0000 (16:30 +0000)
htdocs/admin/lists.php [moved from htdocs/admin/gerer_listes.php with 75% similarity]
htdocs/listes/index.php
scripts/migration.sql
templates/admin/index.tpl
templates/admin/lists.tpl [new file with mode: 0644]
templates/listes/index.tpl
templates/listes/listes.inc.tpl

similarity index 75%
rename from htdocs/admin/gerer_listes.php
rename to htdocs/admin/lists.php
index 6386950..80f5c33 100644 (file)
  *  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();
 ?>
index b459d0f..24fe600 100644 (file)
@@ -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");
index 4613b97..5612a32 100644 (file)
@@ -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)
index 6848d1a..683947b 100644 (file)
@@ -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 @@
       <a href="../webalizer/">Webalizer</a>
   </td></tr>
   <tr class="impair"><td>
-      <strong>S&eacute;curit&eacute; : </strong>
+      <strong>Sécurité : </strong>
       <a href="logger.php">Logs des sessions</a> &nbsp;&nbsp;|&nbsp;&nbsp;
       <a href="logger_actions.php">Actions</a>
   </td></tr>
@@ -57,7 +57,7 @@
   <tr class="pair"><td>
       <strong>Infos dynamiques : </strong>
       <a href="gerer_coupure.php">Coupures</a> &nbsp;&nbsp;|&nbsp;&nbsp;
-      <a href="evenements.php">&Eacute;v&eacute;nements</a>
+      <a href="evenements.php">événements</a>
   </td></tr>
   <tr class="impair"><td>
       <strong>Champs profil : </strong>
   </td></tr>
   <tr class="pair"><td>
       <strong>Newsletter : </strong>
-      <a href="newsletter_prep.php">Pr&eacute;paration</a> &nbsp;&nbsp;|&nbsp;&nbsp;
+      <a href="newsletter_prep.php">Préparation</a> &nbsp;&nbsp;|&nbsp;&nbsp;
       <a href="newsletter_archi.php">Archives</a> &nbsp;&nbsp;|&nbsp;&nbsp;
       <a href="newsletter_pattecassee.php">Adresses en panne</a>  
   </td></tr>
   <tr class="impair"><td>
       <strong>Administrer : </strong>
       <a href="gerer_auth-groupex.php">Auth Groupes X</a>&nbsp;&nbsp;|&nbsp;&nbsp;
-      <a href="../listes/gere_listes.php">Listes</a>
+      <a href="lists.php">Listes</a>
   </td></tr>
   <tr class="pair"><td>
       <strong>Valider demandes : </strong>
       <a href="valider.php">Valider</a>
       &nbsp;&nbsp;|&nbsp;&nbsp;
-      <a href="evenements.php">&Eacute;v&eacute;nements</a>
+      <a href="evenements.php">événements</a>
   </td></tr>
   <tr class="impair"><td>
-      <strong>Tr&eacute;sorerie : </strong>
+      <strong>Trésorerie : </strong>
       <a href="../trezo/gere_operations.php">Comptes</a>
       &nbsp;&nbsp;|&nbsp;&nbsp;
       <a href="gerer_paiement.php">Paiements</a>
diff --git a/templates/admin/lists.tpl b/templates/admin/lists.tpl
new file mode 100644 (file)
index 0000000..01546f6
--- /dev/null
@@ -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 $
+ ***************************************************************************}
+
+
+<div class="rubrique">
+   Mail Lists
+</div>
+
+<table class='bicol' cellpadding='0' cellspacing='0'>
+  <tr>
+    <th>Listes</th>
+    <th>Sujet</th>
+    <th>Nb</th>
+  </tr>
+  {foreach from=$listes item=l}
+  <tr class='{cycle values="impair,pair"}'>
+    <td><a href='{"listes/soptions.php"|url}?liste={$l.list}'>{$l.list}</a></td>
+    <td>{$l.desc}</td>
+    <td class='right'>{$l.nbsub}</td>
+  </tr>
+  {/foreach}
+</table>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
index 1929118..8653e50 100644 (file)
@@ -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 $
  ***************************************************************************}
 
 <div class="rubrique">
@@ -49,9 +49,16 @@ Pour se d
   La diffusion sur une liste de diffusion 
 </div>
 <p>
-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 :
+</p>
+<ul>
+  <li>libre : tout le monde peut y envoyer des mails, la diffusion y est
+  immédiate;</li>
+  <li>restreinte : les membres de la liste peuvent envoyer librement des mails,
+  les extérieurs sont modérés;</li>
+  <li>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.</li>
+</ul>
 </p>
 <p class='smaller'>
 NB : les gestionnaires d'une liste sont aussi ses modérateurs.  
index c9d10d3..13b6588 100644 (file)
  *  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 $
  ***************************************************************************}
 
 <table class='bicol' cellpadding='0' cellspacing='0'>
   <tr>
     <th>Liste</th>
     <th>Description</th>
-    <th>Régulation</th>
+    <th>Diff.</th>
+    <th>Inscr.</th>
     <th>Nb</th>
     <th></th>
   </tr>
@@ -41,7 +42,9 @@
     </td>
     <td>{$liste.desc}</td>
     <td class='center'>
-      {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}
+    </td>
+    <td class='center'>
       {if $liste.ins}modérée{else}libre{/if}
     </td>
     <td class='right'>{$liste.nbsub}</td>