migrate lists.
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 14 Jul 2006 23:05:38 +0000 (23:05 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 14 Jul 2006 23:05:38 +0000 (23:05 +0000)
x.net is now completely b0rked. will be fixed soon

git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@491 839d8a87-29fc-0310-9880-83ba4fa771e5

30 files changed:
hooks/lists.inc.php
htdocs/index.php
htdocs/listes/admin.php [deleted file]
htdocs/listes/archives.php [deleted file]
htdocs/listes/check.php [deleted file]
htdocs/listes/create.php [deleted file]
htdocs/listes/delete.php [deleted file]
htdocs/listes/index.php [deleted file]
htdocs/listes/members.php [deleted file]
htdocs/listes/moderate.php [deleted file]
htdocs/listes/options.php [deleted file]
htdocs/listes/soptions.php [deleted file]
htdocs/listes/trombi.php [deleted file]
modules/lists.php [new file with mode: 0644]
scripts/listes_redirect.php
templates/listes/admin.tpl
templates/listes/archives.tpl
templates/listes/check.tpl
templates/listes/create.tpl
templates/listes/delete.tpl
templates/listes/header_listes.tpl
templates/listes/index.tpl
templates/listes/listes.inc.tpl
templates/listes/members.tpl
templates/listes/moderate.tpl
templates/listes/moderate_mail.tpl
templates/listes/moderate_sub.tpl
templates/listes/options.tpl
templates/listes/soptions.tpl
templates/listes/trombi.tpl

index 0b0aa9a..f209ecb 100644 (file)
@@ -47,7 +47,7 @@ function lists_config()
 function lists_menu()
 {
     global $globals;
-    $globals->menu->addPrivateEntry(XOM_SERVICES, 20, 'Listes de diffusion',   'listes/');
+    $globals->menu->addPrivateEntry(XOM_SERVICES, 20, 'Listes de diffusion',   'lists');
 }
 
 // }}}
index 5021d3e..427dd76 100644 (file)
@@ -25,8 +25,8 @@ require_once dirname(__FILE__).'/../classes/Platal.php';
 require_once dirname(__FILE__).'/../classes/PLModule.php';
 
 $platal = new Platal('auth', 'banana', 'carnet', 'email', 'events', 'geoloc',
-                     'marketing', 'payment', 'platal', 'profile', 'register',
-                     'search', 'stats', 'trezo');
+                     'lists', 'marketing', 'payment', 'platal', 'profile',
+                     'register', 'search', 'stats', 'trezo');
 $platal->run();
 
 ?>
diff --git a/htdocs/listes/admin.php b/htdocs/listes/admin.php
deleted file mode 100644 (file)
index e95769e..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-/***************************************************************************
- *  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                *
- ***************************************************************************/
-
-if (!$page) {
-    require_once("xorg.inc.php");
-    if (!Env::has('liste')) redirect('index.php');
-    $liste  = strtolower(Env::get('liste'));
-    $domain = $globals->mail->domain;
-
-    new_skinned_page('listes/admin.tpl', AUTH_MDP);
-    require_once('lists.inc.php');
-
-    $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
-}
-
-if (Env::has('add_member')) {
-
-    require_once('user.func.inc.php');
-    $members = explode(' ', Env::get('add_member'));
-    if ($members) foreach ($members as $i => $alias) {
-       if (($login = get_user_forlife($alias)) !== false) {;
-               $members[$i] = $login;
-       }
-    }
-    
-    $arr = $client->mass_subscribe($liste, $members);
-    if (is_array($arr)) {
-       foreach($arr as $addr) {
-                   $page->trig("{$addr[0]} inscrit.");
-               }
-    }
-}
-
-if (Env::has('del_member')) {
-    if (strpos(Env::get('del_member'), '@') === false) {
-        $client->mass_unsubscribe($liste, Array(Env::get('del_member').'@'.$globals->mail->domain));
-    } else {
-        $client->mass_unsubscribe($liste, Array(Env::get('del_member')));
-    }
-    redirect("{$_SERVER['PHP_SELF']}?liste=$liste");
-}
-
-if (Env::has('add_owner')) {
-    require_once('user.func.inc.php');
-
-    $owners = explode(' ', Env::get('add_owner'));
-
-    if ($owners) foreach ($owners as $alias) {
-        if (($login = get_user_forlife($alias)) === false) {;
-            $login = $alias;
-        }
-
-        if($client->add_owner($liste, $login)) {
-            $page->trig($alias." ajouté aux modérateurs.");
-        }
-    }
-}
-
-if (Env::has('del_owner')) {
-    if (strpos(Env::get('del_owner'), '@') === false) {
-        $client->del_owner($liste, Env::get('del_owner').'@'.$globals->mail->domain);
-    } else {
-        $client->del_owner($liste, Env::get('del_owner'));
-    }
-    redirect("{$_SERVER['PHP_SELF']}?liste=$liste");
-}
-
-if(list($det,$mem,$own) = $client->get_members($liste)) {
-    
-    $membres = list_sort_members($mem, $tri_promo);
-    $moderos = list_sort_owners($own, $tri_promo);
-
-    $page->assign_by_ref('details', $det);
-    $page->assign_by_ref('members', $membres);
-    $page->assign_by_ref('owners',  $moderos);
-    $page->assign('np_m', count($mem));
-
-} else {
-    $page->kill("La liste n'existe pas ou tu n'as pas le droit de l'administrer");
-}
-
-$page->run();
-?>
diff --git a/htdocs/listes/archives.php b/htdocs/listes/archives.php
deleted file mode 100644 (file)
index 86d4e67..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-/***************************************************************************
- *  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                *
- ***************************************************************************/
-
-if (!$page) {
-    require_once("xorg.inc.php");
-    if (!Env::has('liste')) redirect('index.php');
-    $liste = strtolower(Env::get('liste'));
-    $domain = $globals->mail->domain;
-
-    new_skinned_page('listes/archives.tpl', AUTH_COOKIE);
-    require_once('lists.inc.php');
-
-    $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
-}
-
-$page->addCssLink('css/lists.archives.css');
-if (list($det) = $client->get_members($liste)) {
-    if ( substr($liste,0,5) != 'promo' && ( $det['ins'] || $det['priv'] ) && !$det['own'] && ($det['sub']<2) ) {
-        $page->kill("La liste n'existe pas ou tu n'as pas le droit de la consulter");
-    } elseif (Get::has('file')) {
-        $file = Get::get('file');
-        $rep  = Get::get('rep');
-        if(strstr('/', $file)!==false || !preg_match(',^\d+/\d+$,', $rep)) {
-            $page->kill("La liste n'existe pas ou tu n'as pas le droit de la consulter");
-        } else { 
-            $page->assign('archives', $globals->lists->spool."/{$domain}{$globals->lists->vhost_sep}$liste/$rep/$file");
-        }
-    } else {
-        $archs = Array();
-        foreach (glob($globals->lists->spool."/{$domain}{$globals->lists->vhost_sep}$liste/*/*") as $rep) {
-            if (preg_match(",/(\d*)/(\d*)$,", $rep, $matches)) {
-                $archs[intval($matches[1])][intval($matches[2])] = true;
-            }
-        }
-        $page->assign('archs', $archs);
-        $page->assign('range', range(1,12));
-    }
-} else {
-    $page->kill("La liste n'existe pas ou tu n'as pas le droit de la consulter");
-}
-
-$page->run();
-?>
diff --git a/htdocs/listes/check.php b/htdocs/listes/check.php
deleted file mode 100644 (file)
index 5b4aa44..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-/***************************************************************************
- *  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                *
- ***************************************************************************/
-
-if (!$page) {
-    require_once("xorg.inc.php");
-    if (!Env::has('liste')) redirect('index.php');
-    $liste = strtolower(Env::get('liste'));
-
-    new_admin_page('listes/check.tpl');
-    require_once('lists.inc.php');
-
-    $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
-}
-
-if(Post::has('correct')) {
-    $client->check_options($liste, true);
-}
-
-if(list($details,$options) = $client->check_options($liste)) {
-    $page->assign_by_ref('details', $details);
-    $page->assign_by_ref('options', $options);
-} else {
-    $page->kill("La liste n'existe pas");
-}
-
-$page->run();
-?>
diff --git a/htdocs/listes/create.php b/htdocs/listes/create.php
deleted file mode 100644 (file)
index 4fe48db..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-<?php
-/***************************************************************************
- *  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                *
- ***************************************************************************/
-
-require_once("xorg.inc.php");
-new_skinned_page('listes/create.tpl', AUTH_MDP);
-
-$owners  = preg_split("/[\s]+/", Post::get('owners'), -1, PREG_SPLIT_NO_EMPTY);
-$members = preg_split("/[\s]+/", Post::get('members'), -1, PREG_SPLIT_NO_EMPTY);
-
-// click on validate button 'add_owner_sub' or type <enter>
-if (Post::has('add_owner_sub') && Post::has('add_owner')) {
-    require_once('user.func.inc.php');
-    // if we want to add an owner and then type <enter>, then both add_owner_sub and add_owner are filled.
-    if (Post::get('add_owner') != "") {
-        if (($forlife = get_user_forlife(Post::get('add_owner'))) !== false) {
-            $owners [] = $forlife;
-        }
-        // if we want to add a member and then type <enter>, then add_owner_sub is filled, whereas add_owner is empty.
-    } else if (Post::has('add_member')) {
-        if (($forlife = get_user_forlife(Post::get('add_member'))) !== false) {
-            $members[] = $forlife;
-        }
-    }
-}
-
-// click on validate button 'add_member_sub'
-if (Post::has('add_member_sub') && Post::has('add_member')) {
-    require_once('user.func.inc.php');
-    if (($forlife = get_user_forlife(Post::get('add_member'))) !== false) {
-        $members[] = $forlife;
-    }
-}
-
-ksort($owners);         array_unique($owners);
-ksort($members); array_unique($members);
-
-if (Post::has('submit')) {
-
-    $liste = Post::get('liste');
-
-    if(empty($liste)) {
-        $page->trig('champs «addresse souhaitée» vide');
-    }
-    if(!preg_match("/^[a-zA-Z0-9\-]*$/", $liste)) {
-       $page->trig('le nom de la liste ne doit contenir que des lettres, chiffres et tirets');
-    }
-
-    $res = $globals->xdb->query("SELECT COUNT(*) FROM aliases WHERE alias={?}", $liste);
-    $n   = $res->fetchOneCell();
-
-    if($n) {
-        $page->trig('cet alias est déjà pris');
-    }
-
-    if(!Post::get(desc)) {
-        $page->trig('le sujet est vide');
-    }
-    
-    if(!count($owners)) {
-        $page->trig('pas de gestionnaire');
-    }
-    
-    if(count($members)<4) {
-        $page->trig('pas assez de membres');
-    }
-
-    if (!$page->nb_errs()) {
-       $page->assign('created', true);
-       require_once('validations.inc.php');
-       $req = new ListeReq(Session::getInt('uid'), $liste, Post::get('desc'),
-                Post::getInt('advertise'), Post::getInt('modlevel'), Post::getInt('inslevel'),
-                $owners, $members);
-        $req->submit();
-    }
-}
-
-$page->assign('owners', join(' ', $owners));
-$page->assign('members', join(' ', $members));
-$page->run();
-?>
diff --git a/htdocs/listes/delete.php b/htdocs/listes/delete.php
deleted file mode 100644 (file)
index ef747a9..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-/***************************************************************************
- *  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                *
- ***************************************************************************/
-
-if (!$page) {
-    require_once("xorg.inc.php");
-    if (!Env::has('liste')) redirect('index.php');
-    $liste = strtolower(Env::get('liste'));
-
-    new_skinned_page('listes/delete.tpl', AUTH_MDP);
-    require_once('lists.inc.php');
-
-    $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
-}
-
-if ( Post::get('valid') == 'OUI' && $client->delete_list($liste, Post::getBool('del_archive')) ) {
-    foreach (array('', '-owner', '-admin', '-bounces') as $app) {
-        $globals->xdb->execute("DELETE FROM  aliases
-                                      WHERE  type='liste' AND alias='{?}'",
-                               $ml.$app);
-    }
-    $page->assign('deleted', true);
-} elseif (list($details,$options) = $client->get_owner_options($liste)) {
-    $page->assign_by_ref('details', $details);
-    $page->assign_by_ref('options', $options);
-    $page->assign('bogo_level', $client->get_bogo_level($liste));
-} else {
-    $page->kill("La liste n'existe pas ou tu n'as pas le droit de l'administrer");
-}
-
-$page->run();
-?>
diff --git a/htdocs/listes/index.php b/htdocs/listes/index.php
deleted file mode 100644 (file)
index 3184fa5..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-/***************************************************************************
- *  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                *
- ***************************************************************************/
-
-require_once("xorg.inc.php");
-new_skinned_page('listes/index.tpl', AUTH_MDP);
-$page->assign('xorg_title','Polytechnique.org - Listes de diffusion');
-require_once('lists.inc.php');
-
-$client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
-
-if(Get::has('del')) {
-    $client->unsubscribe(Get::get('del'));
-    redirect('index.php');
-}
-if(Get::has('add')) {
-    $client->subscribe(Get::get('add'));
-    redirect('index.php');
-}
-if(Post::has('promo_add')) {
-    $promo = Post::getInt('promo_add');
-    if ($promo>=1900 and $promo<2100) {
-       $client->subscribe("promo$promo");
-    } else {
-        $page->trig("promo incorrecte, il faut une promo sur 4 chiffres.");
-    }
-}
-$listes = $client->get_lists();
-$page->assign_by_ref('listes',$listes);
-$page->run();
-?>
diff --git a/htdocs/listes/members.php b/htdocs/listes/members.php
deleted file mode 100644 (file)
index 130abee..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-/***************************************************************************
- *  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                *
- ***************************************************************************/
-
-if (!$page) {
-    require_once("xorg.inc.php");
-    if (!Env::has('liste')) redirect('index.php');
-    $liste = strtolower(Env::get('liste'));
-
-    new_skinned_page('listes/members.tpl', AUTH_COOKIE);
-    require_once('lists.inc.php');
-
-    $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
-}
-
-if(Get::has('del')) {
-    $client->unsubscribe($liste);
-    redirect("{$_SERVER['PHP_SELF']}?liste=$liste");
-}
-if(Get::has('add')) {
-    $client->subscribe($liste);
-    redirect("{$_SERVER['PHP_SELF']}?liste=$liste");
-}
-$members = $client->get_members($liste);
-
-$tri_promo = !Env::getBool('alpha');
-
-if(list($det,$mem,$own) = $members) {
-    $membres = list_sort_members($mem, $tri_promo);
-    $moderos = list_sort_owners($own, $tri_promo);
-
-    $page->assign_by_ref('details', $det);
-    $page->assign_by_ref('members', $membres);
-    $page->assign_by_ref('owners',  $moderos);
-    $page->assign('nb_m',  count($mem));
-
-} else {
-    $page->kill("La liste n'existe pas ou tu n'as pas le droit d'en voir les détails");
-}
-
-$page->run();
-?>
diff --git a/htdocs/listes/moderate.php b/htdocs/listes/moderate.php
deleted file mode 100644 (file)
index e4e8f68..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-<?php
-/***************************************************************************
- *  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                *
- ***************************************************************************/
-
-if (!$page) {
-    require_once("xorg.inc.php");
-    if (!Env::has('liste')) redirect('index.php');
-    $liste = strtolower(Env::get('liste'));
-    $domain = $globals->mail->domain;
-
-    if (preg_match("!(?:[a-z0-9]+\\.)?{$domain}_(.*)!", $liste, $matches)) {
-        redirect("{$_SERVER['PHP_SELF']}?liste={$matches[1]}");
-    }
-
-    new_skinned_page('listes/moderate.tpl', AUTH_MDP);
-    require_once('lists.inc.php');
-
-    $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
-}
-
-$page->register_modifier('qpd','quoted_printable_decode');
-
-if(Env::has('sadd')) {
-    $client->handle_request($liste,Env::get('sadd'),4,''); /* 4 = SUBSCRIBE */
-    redirect("{$_SERVER['PHP_SELF']}?liste=$liste");
-}
-
-if(Post::has('sdel')) {
-    $client->handle_request($liste,Post::get('sdel'),2,Post::get('reason')); /* 2 = REJECT */
-}
-
-if(Env::has('mid')) {
-    $mid    = Env::get('mid');
-    $mail   = $client->get_pending_mail($liste, $mid);
-    $reason = '';
-
-    $prenom = Session::get('prenom');
-    $nom    = Session::get('nom');
-
-    
-    if (Env::has('mok')) {
-        $action  = 1; /** 2 = ACCEPT **/
-        $subject = "Message accepté";
-        $append .= "a été accepté par $prenom $nom.\n";
-    } elseif (Env::has('mno')) {
-        $action  = 2; /** 2 = REJECT **/
-        $subject = "Message refusé";
-       $reason  = Post::get('reason');
-        $append  = "a été refusé par $prenom $nom avec la raison :\n\n"
-                .  $reason;
-    } elseif (Env::has('mdel')) {
-        $action  = 3; /** 3 = DISCARD **/
-        $subject = "Message supprimé";
-        $append  = "a été supprimé par $prenom $nom.\n\n"
-                .  "Rappel: il ne faut utiliser cette opération que dans le cas de spams ou de virus !\n";
-    }
-   
-    if (isset($action) && $client->handle_request($liste, $mid, $action, $reason)) {
-        $texte = "le message suivant :\n\n"
-                ."    Auteur: {$mail['sender']}\n"
-                ."    Sujet : « {$mail['subj']} »\n"
-                ."    Date  : ".strftime("le %d %b %Y à %H:%M:%S", (int)$mail['stamp'])."\n\n"
-                .$append;
-        require_once('diogenes/diogenes.hermes.inc.php');
-        $mailer = new HermesMailer();
-        $mailer->addTo("$liste-owner@{$domain}");
-        $mailer->setFrom("$liste-bounces@{$domain}");
-        $mailer->addHeader('Reply-To', "$liste-owner@{$domain}");
-        $mailer->setSubject($subject);
-        $mailer->setTxtBody(wordwrap($texte,72));
-        $mailer->send();
-        Get::kill('mid');
-    }
-
-    if(Get::has('mid') && is_array($mail)) {
-       $msg = file_get_contents('/etc/mailman/fr/refuse.txt');
-       $msg = str_replace("%(adminaddr)s","$liste-owner@{$domain}", $msg);
-       $msg = str_replace("%(request)s","<< SUJET DU MAIL >>", $msg);
-       $msg = str_replace("%(reason)s","<< TON EXPLICATION >>", $msg);
-       $msg = str_replace("%(listname)s","$liste", $msg);
-       $page->assign('msg', $msg); 
-
-       $page->changeTpl('listes/moderate_mail.tpl');
-        $page->assign_by_ref('mail', $mail);
-        $page->run();
-    }
-
-} elseif (Env::has('sid')) {
-
-    if(list($subs,$mails) = $client->get_pending_ops($liste)) {
-       foreach($subs as $user) {
-           if ($user['id'] == Env::get('sid')) {
-                $page->changeTpl('listes/moderate_sub.tpl');
-                $page->assign('del_user',$user);
-                $page->run();
-            }
-       }
-    }
-
-}
-
-if(list($subs,$mails) = $client->get_pending_ops($liste)) {
-    $page->assign_by_ref('subs', $subs);
-    $page->assign_by_ref('mails', $mails);
-} else {
-    $page->kill("La liste n'existe pas ou tu n'as pas le droit de la modérer");
-}
-
-$page->run();
-?>
diff --git a/htdocs/listes/options.php b/htdocs/listes/options.php
deleted file mode 100644 (file)
index bae5752..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-/***************************************************************************
- *  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                *
- ***************************************************************************/
-
-if (!$page) {
-    require_once("xorg.inc.php");
-    if (!Env::has('liste')) redirect('index.php');
-    $liste = strtolower(Env::get('liste'));
-
-    new_skinned_page('listes/options.tpl', AUTH_MDP);
-    require_once('lists.inc.php');
-
-    $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
-}
-
-if (Post::has('submit')) {
-    $values = $_POST;
-    $client->set_bogo_level($liste, intval($values['bogo_level']));
-    switch($values['moderate']) {
-       case '0':
-           $values['generic_nonmember_action']  = 0;
-           $values['default_member_moderation'] = 0;
-           break;
-       case '1':
-           $values['generic_nonmember_action']  = 1;
-           $values['default_member_moderation'] = 0;
-           break;
-       case '2':
-           $values['generic_nonmember_action']  = 1;
-           $values['default_member_moderation'] = 1;
-           break;
-    }
-    unset($values['submit'], $values['bogo_level'], $values['moderate']);
-    $values['send_goodbye_msg']      = !empty($values['send_goodbye_msg']);
-    $values['admin_notify_mchanges'] = !empty($values['admin_notify_mchanges']);
-    $values['subscribe_policy']      = empty($values['subscribe_policy']) ? 0 : 2;
-    if (isset($values['subject_prefix'])) {
-       $values['subject_prefix'] = trim($values['subject_prefix']).' ';
-    }
-    $client->set_owner_options($liste, $values);
-} elseif (isvalid_email(Post::get('atn_add'))) {
-    $client->add_to_wl($liste, Post::get('atn_add'));
-} elseif (Get::has('atn_del')) {
-    $client->del_from_wl($liste, Get::get('atn_del'));
-    redirect("{$_SERVER['PHP_SELF']}?liste=$liste");
-}
-
-if(list($details,$options) = $client->get_owner_options($liste)) {
-    $page->assign_by_ref('details', $details);
-    $page->assign_by_ref('options', $options);
-    $page->assign('bogo_level', $client->get_bogo_level($liste));
-} else {
-    $page->kill("La liste n'existe pas ou tu n'as pas le droit de l'administrer");
-}
-
-$page->run();
-?>
diff --git a/htdocs/listes/soptions.php b/htdocs/listes/soptions.php
deleted file mode 100644 (file)
index b4c5a72..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-/***************************************************************************
- *  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                *
- ***************************************************************************/
-
-if (!$page) {
-    require_once("xorg.inc.php");
-    if (!Env::has('liste')) redirect('index.php');
-    $liste = strtolower(Env::get('liste'));
-
-    new_admin_page('listes/soptions.tpl');
-    require_once('lists.inc.php');
-
-    $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
-}
-
-if(Post::has('submit')) {
-    $values = $_POST;
-    unset($values['submit']);
-    $values['advertised'] = empty($values['advertised']) ? false : true;
-    $values['archive'] = empty($values['archive']) ? false : true;
-    $client->set_admin_options($liste, $values);
-}
-
-if(list($details,$options) = $client->get_admin_options($liste)) {
-    $page->assign_by_ref('details', $details);
-    $page->assign_by_ref('options', $options);
-} else {
-    $page->kill("La liste n'existe pas");
-}
-
-$page->run();
-?>
diff --git a/htdocs/listes/trombi.php b/htdocs/listes/trombi.php
deleted file mode 100644 (file)
index 11d68e6..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/***************************************************************************
- *  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                *
- ***************************************************************************/
-
-require_once("xorg.inc.php");
-if (!Env::has('liste')) redirect('index.php');
-$liste = strtolower(Env::get('liste'));
-
-new_skinned_page('listes/trombi.tpl', AUTH_COOKIE);
-require_once("trombi.inc.php");
-require_once('lists.inc.php');
-
-$client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
-
-if(Get::has('del')) {
-    $client->unsubscribe($liste);
-    redirect("{$_SERVER['PHP_SELF']}?liste=$liste");
-}
-if(Get::has('add')) {
-    $client->subscribe($liste);
-    redirect("{$_SERVER['PHP_SELF']}?liste=$liste");
-}
-
-function getList($offset,$limit)
-{
-    global $client, $globals;
-    $liste = Env::get('liste');
-    list($total,$members) = $client->get_members_limit($liste,$offset,$limit);
-
-    $membres = Array();
-    foreach ($members as $member) {
-        list($m) = explode('@',$member[1]);
-        $res = $globals->xdb->query("SELECT  prenom,IF(nom_usage='', nom, nom_usage) AS nom, promo, a.alias AS forlife
-                                       FROM  auth_user_md5 AS u
-                                 INNER JOIN  aliases AS a ON u.user_id = a.id
-                                      WHERE  a.alias = {?}", $m);
-        if ($tmp = $res->fetchOneAssoc()) {
-            $membres[$tmp['nom']] = $tmp;
-        } else {
-            $membres[$member[0]] = Array('addr' => $member[0]);
-        }
-    }
-    return Array($total,$membres);
-}
-
-$owners = $client->get_owners($liste);
-
-if(is_array($owners)) {
-    $moderos = list_sort_owners($owners[1]);
-
-    $page->assign_by_ref('details', $owners[0]);
-    $page->assign_by_ref('owners',  $moderos);
-    
-    $trombi = new Trombi('getList');
-    $page->assign_by_ref('trombi',$trombi);
-} else {
-    $page->kill("La liste n'existe pas ou tu n'as pas le droit d'en voir les détails");
-}
-
-$page->run();
-?>
diff --git a/modules/lists.php b/modules/lists.php
new file mode 100644 (file)
index 0000000..5d445e6
--- /dev/null
@@ -0,0 +1,625 @@
+<?php
+/***************************************************************************
+ *  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                *
+ ***************************************************************************/
+
+class ListsModule extends PLModule
+{
+    var $client;
+
+    function handlers()
+    {
+        return array(
+            'lists'           => $this->make_hook('lists',     AUTH_MDP),
+            'lists/create'    => $this->make_hook('create',    AUTH_MDP),
+
+            'lists/members'   => $this->make_hook('members',   AUTH_COOKIE),
+            'lists/trombi'    => $this->make_hook('trombi',    AUTH_COOKIE),
+            'lists/archives'  => $this->make_hook('archives',  AUTH_COOKIE),
+
+            'lists/moderate'  => $this->make_hook('moderate',  AUTH_MDP),
+            'lists/admin'     => $this->make_hook('admin',     AUTH_MDP),
+            'lists/options'   => $this->make_hook('options',   AUTH_MDP),
+            'lists/delete'    => $this->make_hook('delete',    AUTH_MDP),
+
+            'lists/soptions'  => $this->make_hook('soptions',  AUTH_MDP),
+            'lists/check'     => $this->make_hook('check',     AUTH_MDP),
+        );
+    }
+
+    function prepare_client()
+    {
+        require_once 'lists.inc.php';
+
+        $this->client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
+    }
+
+    function handler_lists(&$page)
+    {
+        global $globals;
+
+        $this->prepare_client();
+
+        $page->changeTpl('listes/index.tpl');
+        $page->assign('xorg_title','Polytechnique.org - Listes de diffusion');
+
+
+        if (Get::has('del')) {
+            $this->client->unsubscribe(Get::get('del'));
+            redirect('lists');
+        }
+        if (Get::has('add')) {
+            $this->client->subscribe(Get::get('add'));
+            redirect('lists');
+        }
+        if (Post::has('promo_add')) {
+            $promo = Post::getInt('promo_add');
+            if ($promo >= 1900 and $promo < 2100) {
+                $this->client->subscribe("promo$promo");
+            } else {
+                $page->trig("promo incorrecte, il faut une promo sur 4 chiffres.");
+            }
+        }
+        $listes = $this->client->get_lists();
+        $page->assign_by_ref('listes', $listes);
+    }
+
+    function handler_create(&$page)
+    {
+        global $globals;
+        $page->changeTpl('listes/create.tpl');
+
+        $owners  = preg_split("/[\s]+/", Post::get('owners'), -1, PREG_SPLIT_NO_EMPTY);
+        $members = preg_split("/[\s]+/", Post::get('members'), -1, PREG_SPLIT_NO_EMPTY);
+
+        // click on validate button 'add_owner_sub' or type <enter>
+        if (Post::has('add_owner_sub') && Post::has('add_owner')) {
+            require_once('user.func.inc.php');
+            // if we want to add an owner and then type <enter>, then both
+            // add_owner_sub and add_owner are filled.
+            if (Post::get('add_owner') != "") {
+                if (($forlife = get_user_forlife(Post::get('add_owner'))) !== false) {
+                    $owners [] = $forlife;
+                }
+                // if we want to add a member and then type <enter>, then
+                // add_owner_sub is filled, whereas add_owner is empty.
+            } else if (Post::has('add_member')) {
+                if (($forlife = get_user_forlife(Post::get('add_member'))) !== false) {
+                    $members[] = $forlife;
+                }
+            }
+        }
+
+        // click on validate button 'add_member_sub'
+        if (Post::has('add_member_sub') && Post::has('add_member')) {
+            require_once('user.func.inc.php');
+            if (($forlife = get_user_forlife(Post::get('add_member'))) !== false) {
+                $members[] = $forlife;
+            }
+        }
+
+        ksort($owners);         array_unique($owners);
+        ksort($members); array_unique($members);
+
+        $page->assign('owners', join(' ', $owners));
+        $page->assign('members', join(' ', $members));
+
+        if (!Post::has('submit')) {
+            return;
+        }
+
+        $liste = Post::get('liste');
+
+        if (empty($liste)) {
+            $page->trig('champs «addresse souhaitée» vide');
+        }
+        if (!preg_match("/^[a-zA-Z0-9\-]*$/", $liste)) {
+            $page->trig('le nom de la liste ne doit contenir que des lettres, chiffres et tirets');
+        }
+
+        $res = $globals->xdb->query("SELECT COUNT(*) FROM aliases WHERE alias={?}", $liste);
+        $n   = $res->fetchOneCell();
+
+        if ($n) {
+            $page->trig('cet alias est déjà pris');
+        }
+
+        if (!Post::get(desc)) {
+            $page->trig('le sujet est vide');
+        }
+
+        if (!count($owners)) {
+            $page->trig('pas de gestionnaire');
+        }
+
+        if (count($members)<4) {
+            $page->trig('pas assez de membres');
+        }
+
+        if (!$page->nb_errs()) {
+            $page->assign('created', true);
+            require_once 'validations.inc.php';
+            $req = new ListeReq(Session::getInt('uid'), $liste,
+                                Post::get('desc'), Post::getInt('advertise'),
+                                Post::getInt('modlevel'), Post::getInt('inslevel'),
+                                $owners, $members);
+            $req->submit();
+        }
+    }
+
+    function handler_members(&$page, $liste = null)
+    {
+        global $globals;
+
+        if (is_null($liste)) {
+            return PL_NOT_FOUND;
+        }
+
+        $this->prepare_client();
+
+        $page->changeTpl('listes/members.tpl');
+
+        if (Get::has('del')) {
+            $this->client->unsubscribe($liste);
+            redirect($liste);
+        }
+
+        if (Get::has('add')) {
+            $this->client->subscribe($liste);
+            redirect($liste);
+        }
+
+        $members = $this->client->get_members($liste);
+
+        $tri_promo = !Env::getBool('alpha');
+
+        if (list($det,$mem,$own) = $members) {
+            $membres = list_sort_members($mem, $tri_promo);
+            $moderos = list_sort_owners($own, $tri_promo);
+
+            $page->assign_by_ref('details', $det);
+            $page->assign_by_ref('members', $membres);
+            $page->assign_by_ref('owners',  $moderos);
+            $page->assign('nb_m',  count($mem));
+        } else {
+            $page->kill("La liste n'existe pas ou tu n'as pas le droit d'en voir les détails");
+        }
+    }
+
+    function _get_list($offset, $limit)
+    {
+        global $globals, $platal;
+        list($total, $members) = $this->client->get_members_limit($platal->argv[1], $offset, $limit);
+
+        $membres = Array();
+        foreach ($members as $member) {
+            list($m) = explode('@',$member[1]);
+            $res = $globals->xdb->query("SELECT  prenom,if (nom_usage='', nom, nom_usage) AS nom,
+                                                 promo, a.alias AS forlife
+                                           FROM  auth_user_md5 AS u
+                                     INNER JOIN  aliases AS a ON u.user_id = a.id
+                                          WHERE  a.alias = {?}", $m);
+            if ($tmp = $res->fetchOneAssoc()) {
+                $membres[$tmp['nom']] = $tmp;
+            } else {
+                $membres[$member[0]] = array('addr' => $member[0]);
+            }
+        }
+        return array($total, $membres);
+    }
+
+    function handler_trombi(&$page, $liste = null)
+    {
+        global $globals;
+
+        if (is_null($liste)) {
+            return PL_NOT_FOUND;
+        }
+
+        $this->prepare_client();
+
+        $page->changeTpl('listes/trombi.tpl');
+
+        if (Get::has('del')) {
+            $this->client->unsubscribe($liste);
+            redirect($liste);
+        }
+        if (Get::has('add')) {
+            $this->client->subscribe($liste);
+            redirect($liste);
+        }
+
+        $owners = $this->client->get_owners($liste);
+
+        if (is_array($owners)) {
+            require_once 'trombi.inc.php';
+            $moderos = list_sort_owners($owners[1]);
+
+            $page->assign_by_ref('details', $owners[0]);
+            $page->assign_by_ref('owners',  $moderos);
+
+            $trombi = new Trombi(array(&$this, '_get_list'));
+            $page->assign('trombi', $trombi);
+        } else {
+            $page->kill("La liste n'existe pas ou tu n'as pas le droit d'en voir les détails");
+        }
+    }
+
+    function handler_archives(&$page, $liste = null)
+    {
+        global $globals;
+
+        if (is_null($liste)) {
+            return PL_NOT_FOUND;
+        }
+
+        $this->prepare_client();
+
+        $page->changeTpl('listes/archives.tpl');
+
+        $page->addCssLink('css/lists.archives.css');
+        if (list($det) = $this->client->get_members($liste)) {
+            if (substr($liste,0,5) != 'promo' && ($det['ins'] || $det['priv'])
+            && !$det['own'] && ($det['sub'] < 2))
+            {
+                $page->kill("La liste n'existe pas ou tu n'as pas le droit de la consulter");
+            } elseif (Get::has('file')) {
+                $file = Get::get('file');
+                $rep  = Get::get('rep');
+                if (strstr('/', $file)!==false || !preg_match(',^\d+/\d+$,', $rep)) {
+                    $page->kill("La liste n'existe pas ou tu n'as pas le droit de la consulter");
+                } else { 
+                    $page->assign('archives', $globals->lists->spool
+                                  ."/{$domain}{$globals->lists->vhost_sep}$liste/$rep/$file");
+                }
+            } else {
+                $archs = Array();
+                foreach (glob($globals->lists->spool
+                              ."/{$domain}{$globals->lists->vhost_sep}$liste/*/*") as $rep)
+                {
+                    if (preg_match(",/(\d*)/(\d*)$,", $rep, $matches)) {
+                        $archs[intval($matches[1])][intval($matches[2])] = true;
+                    }
+                }
+                $page->assign('archs', $archs);
+                $page->assign('range', range(1,12));
+            }
+        } else {
+            $page->kill("La liste n'existe pas ou tu n'as pas le droit de la consulter");
+        }
+    }
+
+    function handler_moderate(&$page, $liste = null)
+    {
+        global $globals;
+
+        if (is_null($liste)) {
+            return PL_NOT_FOUND;
+        }
+
+        $this->prepare_client();
+
+        $page->changeTpl('listes/moderate.tpl');
+
+        $page->register_modifier('qpd', 'quoted_printable_decode');
+
+        if (Env::has('sadd')) { /* 4 = SUBSCRIBE */
+            $this->client->handle_request($liste,Env::get('sadd'),4,'');
+            redirect($liste);
+        }
+
+        if (Post::has('sdel')) { /* 2 = REJECT */
+            $this->client->handle_request($liste,Post::get('sdel'),2,Post::get('reason'));
+        }
+
+        if (Env::has('mid')) {
+            $mid    = Env::get('mid');
+            $mail   = $this->client->get_pending_mail($liste, $mid);
+            $reason = '';
+
+            $prenom = Session::get('prenom');
+            $nom    = Session::get('nom');
+
+            if (Env::has('mok')) {
+                $action  = 1; /** 2 = ACCEPT **/
+                $subject = "Message accepté";
+                $append .= "a été accepté par $prenom $nom.\n";
+            } elseif (Env::has('mno')) {
+                $action  = 2; /** 2 = REJECT **/
+                $subject = "Message refusé";
+                $reason  = Post::get('reason');
+                $append  = "a été refusé par $prenom $nom avec la raison :\n\n"
+                        .  $reason;
+            } elseif (Env::has('mdel')) {
+                $action  = 3; /** 3 = DISCARD **/
+                $subject = "Message supprimé";
+                $append  = "a été supprimé par $prenom $nom.\n\n"
+                        .  "Rappel: il ne faut utiliser cette opération "
+                        .  "que dans le cas de spams ou de virus !\n";
+            }
+
+            if (isset($action) && $this->client->handle_request($liste, $mid, $action, $reason)) {
+                $texte = "le message suivant :\n\n"
+                        ."    Auteur: {$mail['sender']}\n"
+                        ."    Sujet : « {$mail['subj']} »\n"
+                        ."    Date  : ".strftime("le %d %b %Y à %H:%M:%S", (int)$mail['stamp'])."\n\n"
+                        .$append;
+                require_once 'diogenes/diogenes.hermes.inc.php';
+                $mailer = new HermesMailer();
+                $mailer->addTo("$liste-owner@{$domain}");
+                $mailer->setFrom("$liste-bounces@{$domain}");
+                $mailer->addHeader('Reply-To', "$liste-owner@{$domain}");
+                $mailer->setSubject($subject);
+                $mailer->setTxtBody(wordwrap($texte,72));
+                $mailer->send();
+                Get::kill('mid');
+            }
+
+            if (Get::has('mid') && is_array($mail)) {
+                $msg = file_get_contents('/etc/mailman/fr/refuse.txt');
+                $msg = str_replace("%(adminaddr)s", "$liste-owner@{$domain}", $msg);
+                $msg = str_replace("%(request)s",   "<< SUJET DU MAIL >>",    $msg);
+                $msg = str_replace("%(reason)s",    "<< TON EXPLICATION >>",  $msg);
+                $msg = str_replace("%(listname)s",  $liste, $msg);
+                $page->assign('msg', $msg); 
+
+                $page->changeTpl('listes/moderate_mail.tpl');
+                $page->assign_by_ref('mail', $mail);
+                $page->run();
+            }
+
+        } elseif (Env::has('sid')) {
+
+            if (list($subs,$mails) = $this->client->get_pending_ops($liste)) {
+                foreach($subs as $user) {
+                    if ($user['id'] == Env::get('sid')) {
+                        $page->changeTpl('listes/moderate_sub.tpl');
+                        $page->assign('del_user',$user);
+                        $page->run();
+                    }
+                }
+            }
+
+        }
+
+        if (list($subs,$mails) = $this->client->get_pending_ops($liste)) {
+            $page->assign_by_ref('subs', $subs);
+            $page->assign_by_ref('mails', $mails);
+        } else {
+            $page->kill("La liste n'existe pas ou tu n'as pas le droit de la modérer");
+        }
+    }
+
+    function handler_admin(&$page, $liste = null)
+    {
+        global $globals;
+
+        if (is_null($liste)) {
+            return PL_NOT_FOUND;
+        }
+
+        $this->prepare_client();
+
+        $page->changeTpl('listes/admin.tpl');
+
+        if (Env::has('add_member')) {
+
+            require_once('user.func.inc.php');
+            $members = explode(' ', Env::get('add_member'));
+            if ($members) foreach ($members as $i => $alias) {
+                if (($login = get_user_forlife($alias)) !== false) {;
+                        $members[$i] = $login;
+                }
+            }
+
+            $arr = $this->client->mass_subscribe($liste, $members);
+            if (is_array($arr)) {
+                foreach($arr as $addr) {
+                    $page->trig("{$addr[0]} inscrit.");
+                }
+            }
+        }
+
+        if (Env::has('del_member')) {
+            if (strpos(Env::get('del_member'), '@') === false) {
+                $this->client->mass_unsubscribe(
+                    $liste, array(Env::get('del_member').'@'.$globals->mail->domain));
+            } else {
+                $this->client->mass_unsubscribe($liste, array(Env::get('del_member')));
+            }
+            redirect($liste);
+        }
+
+        if (Env::has('add_owner')) {
+            require_once('user.func.inc.php');
+
+            $owners = explode(' ', Env::get('add_owner'));
+
+            if ($owners) foreach ($owners as $alias) {
+                if (($login = get_user_forlife($alias)) === false) {;
+                    $login = $alias;
+                }
+
+                if ($this->client->add_owner($liste, $login)) {
+                    $page->trig($alias." ajouté aux modérateurs.");
+                }
+            }
+        }
+
+        if (Env::has('del_owner')) {
+            if (strpos(Env::get('del_owner'), '@') === false) {
+                $this->client->del_owner($liste, Env::get('del_owner').'@'.$globals->mail->domain);
+            } else {
+                $this->client->del_owner($liste, Env::get('del_owner'));
+            }
+            redirect($liste);
+        }
+
+        if (list($det,$mem,$own) = $this->client->get_members($liste)) {
+
+            $membres = list_sort_members($mem, $tri_promo);
+            $moderos = list_sort_owners($own, $tri_promo);
+
+            $page->assign_by_ref('details', $det);
+            $page->assign_by_ref('members', $membres);
+            $page->assign_by_ref('owners',  $moderos);
+            $page->assign('np_m', count($mem));
+
+        } else {
+            $page->kill("La liste n'existe pas ou tu n'as pas le droit de l'administrer");
+        }
+    }
+
+    function handler_options(&$page, $liste = null)
+    {
+        global $globals;
+
+        if (is_null($liste)) {
+            return PL_NOT_FOUND;
+        }
+
+        $this->prepare_client();
+
+        $page->changeTpl('listes/options.tpl');
+
+        if (Post::has('submit')) {
+            $values = $_POST;
+            $this->client->set_bogo_level($liste, intval($values['bogo_level']));
+            switch($values['moderate']) {
+                case '0':
+                    $values['generic_nonmember_action']  = 0;
+                    $values['default_member_moderation'] = 0;
+                    break;
+                case '1':
+                    $values['generic_nonmember_action']  = 1;
+                    $values['default_member_moderation'] = 0;
+                    break;
+                case '2':
+                    $values['generic_nonmember_action']  = 1;
+                    $values['default_member_moderation'] = 1;
+                    break;
+            }
+            unset($values['submit'], $values['bogo_level'], $values['moderate']);
+            $values['send_goodbye_msg']      = !empty($values['send_goodbye_msg']);
+            $values['admin_notify_mchanges'] = !empty($values['admin_notify_mchanges']);
+            $values['subscribe_policy']      = empty($values['subscribe_policy']) ? 0 : 2;
+            if (isset($values['subject_prefix'])) {
+                $values['subject_prefix'] = trim($values['subject_prefix']).' ';
+            }
+            $this->client->set_owner_options($liste, $values);
+        } elseif (isvalid_email(Post::get('atn_add'))) {
+            $this->client->add_to_wl($liste, Post::get('atn_add'));
+        } elseif (Get::has('atn_del')) {
+            $this->client->del_from_wl($liste, Get::get('atn_del'));
+            redirect("{$_SERVER['PHP_SELF']}?liste=$liste");
+        }
+
+        if (list($details,$options) = $this->client->get_owner_options($liste)) {
+            $page->assign_by_ref('details', $details);
+            $page->assign_by_ref('options', $options);
+            $page->assign('bogo_level', $this->client->get_bogo_level($liste));
+        } else {
+            $page->kill("La liste n'existe pas ou tu n'as pas le droit de l'administrer");
+        }
+    }
+
+    function handler_delete(&$page, $liste = null)
+    {
+        global $globals;
+
+        if (is_null($liste)) {
+            return PL_NOT_FOUND;
+        }
+
+        $this->prepare_client();
+
+        $page->changeTpl('listes/delete.tpl');
+
+        if (Post::get('valid') == 'OUI'
+        && $this->client->delete_list($liste, Post::getBool('del_archive')))
+        {
+            foreach (array('', '-owner', '-admin', '-bounces') as $app) {
+                $globals->xdb->execute("DELETE FROM  aliases
+                                              WHERE  type='liste' AND alias='{?}'",
+                                       $ml.$app);
+            }
+            $page->assign('deleted', true);
+        } elseif (list($details,$options) = $this->client->get_owner_options($liste)) {
+            $page->assign_by_ref('details', $details);
+            $page->assign_by_ref('options', $options);
+            $page->assign('bogo_level', $this->client->get_bogo_level($liste));
+        } else {
+            $page->kill("La liste n'existe pas ou tu n'as pas le droit de l'administrer");
+        }
+    }
+
+    function handler_soptions(&$page, $liste = null)
+    {
+        global $globals;
+
+        if (is_null($liste)) {
+            return PL_NOT_FOUND;
+        }
+
+        $this->prepare_client();
+
+        $page->changeTpl('listes/soptions.tpl');
+
+        if (Post::has('submit')) {
+            $values = $_POST;
+            unset($values['submit']);
+            $values['advertised'] = empty($values['advertised']) ? false : true;
+            $values['archive'] = empty($values['archive']) ? false : true;
+            $this->client->set_admin_options($liste, $values);
+        }
+
+        if (list($details,$options) = $this->client->get_admin_options($liste)) {
+            $page->assign_by_ref('details', $details);
+            $page->assign_by_ref('options', $options);
+        } else {
+            $page->kill("La liste n'existe pas");
+        }
+    }
+
+    function handler_check(&$page, $liste = null)
+    {
+        global $globals;
+
+        if (is_null($liste)) {
+            return PL_NOT_FOUND;
+        }
+
+        $this->prepare_client();
+
+        $page->changeTpl('listes/check.tpl');
+
+        if (Post::has('correct')) {
+            $this->client->check_options($liste, true);
+        }
+
+        if (list($details,$options) = $this->client->check_options($liste)) {
+            $page->assign_by_ref('details', $details);
+            $page->assign_by_ref('options', $options);
+        } else {
+            $page->kill("La liste n'existe pas");
+        }
+    }
+}
+
+?>
index 4a93889..8c3f948 100644 (file)
@@ -7,12 +7,12 @@ if (empty($matches)) {
     $mbox   = $matches[2];
     $fqdn   = strtolower($matches[3]);
     if ($fqdn == 'polytechnique.org') {
-        header("Location: https://www.polytechnique.org/listes/$action.php?liste=$mbox");
+        header("Location: https://www.polytechnique.org/lists/$action/$mbox");
     } else {
         require("../include/xorg.inc.php");
         $res = $globals->xdb->query("select diminutif from groupex.asso where mail_domain = {?}", $fqdn);
         if ($gpx = $res->fetchOneCell()) {
-            header("Location: http://www.polytechnique.net/$gpx/listes-$action.php?liste=$mbox");
+            header("Location: http://www.polytechnique.net/$gpx/lists/$action/$mbox");
         }
     }
 }
index f9bb46c..612ce84 100644 (file)
@@ -52,7 +52,7 @@ qui y 
         {else}
         {$x.l}
         {/if}
-        <a href='?liste={$smarty.get.liste}&amp;del_owner={$x.l}'><img src='{rel}/images/retirer.gif' alt='retirer modérateur' title='retirer modérateur' /></a>
+        <a href='{rel}/{$platal->ns}lists/admin/{$platal->argv[1]}?del_owner={$x.l}'><img src='{rel}/images/retirer.gif' alt='retirer modérateur' title='retirer modérateur' /></a>
         <br />
         {/foreach}
       </td>
@@ -86,7 +86,7 @@ qui y 
         {else}
         {$x.l}
         {/if}
-        <a href='?liste={$smarty.get.liste}&amp;del_member={$x.l}'><img src='{rel}/images/retirer.gif' alt='retirer membre' title='retirer membre' /></a>
+        <a href='{rel}/{$platal->ns}lists/admin/{$platal->argv[1]}?del_member={$x.l}'><img src='{rel}/images/retirer.gif' alt='retirer membre' title='retirer membre' /></a>
         <br />
         {/foreach}
       </td>
index f1e4d7e..e62ee93 100644 (file)
@@ -25,7 +25,7 @@
 
 
 {if $archs}
-<h1>Archives de la liste {$smarty.request.liste}</h1>
+<h1>Archives de la liste {$platal->argv[1]}</h1>
 
 <h2>Triés par fils de discussion</h2>
 
@@ -42,7 +42,7 @@
     {foreach from=$range item=i}
     <td>
       {if $m[$i]}
-      <a href="?liste={$smarty.request.liste}&amp;rep={$y}/{$i|string_format:"%02u"}&amp;file=threads.html">{"0000-$i-01"|date_format:"%B"}</a>
+      <a href="{rel}/{$platal->ns}lists/archives/{$platal->argv[1]}?rep={$y}/{$i|string_format:"%02u"}&amp;file=threads.html">{"0000-$i-01"|date_format:"%B"}</a>
       {else}
       &nbsp;
       {/if}
@@ -68,7 +68,7 @@
     {foreach from=$range item=i}
     <td>
       {if $m[$i]}
-      <a href="?liste={$smarty.request.liste}&amp;rep={$y}/{$i|string_format:"%02u"}&amp;file=dates.html">{"0000-$i-01"|date_format:"%B"}</a>
+      <a href="{rel}/{$platal->ns}lists/archives/{$platal->argv[1]}?rep={$y}/{$i|string_format:"%02u"}&amp;file=dates.html">{"0000-$i-01"|date_format:"%B"}</a>
       {else}
       &nbsp;
       {/if}
index 14928cc..b146930 100644 (file)
@@ -35,7 +35,7 @@
   </tr>
   {/foreach}
 </table>
-<form action='{$smarty.server.REQUEST_URI}' method='post'>
+<form action='{rel}/{$platal->ns}lists/check/{$platal->argv[1]}' method='post'>
   <div class='center'>
     <br />
     <input type='submit' name='correct' value='Corriger les valeurs !' />
index b6f0bc1..1bcc775 100644 (file)
@@ -37,7 +37,7 @@ moins 4 polytechniciens inscrits sur le site, et de fournir les informations sui
 liste :
 </p>
 
-<form action='{$smarty.server.PHP_SELF}' method='post'>
+<form action='{rel}/lists/create' method='post'>
   <table class='bicol' cellspacing='0' cellpadding='2'>
     <tr>
       <th colspan='2'>Caractéristiques de la Liste</th>
index 046a682..4977a65 100644 (file)
@@ -40,7 +40,7 @@ Tu n'es pas administrateur de la liste, mais du site.
   Détruire la liste {$details.addr} ?
 </h1>
 
-<form method='post' action='{$smarty.server.REQUEST_URI}'>
+<form method='post' action='{rel}/{$platal->ns}lists/delete/{$platal->argv[1]}'>
   <table class='tinybicol' cellpadding='2' cellspacing='0'>
     <tr class='impair'>
       <td>
index 03697eb..e7b48e5 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 
-{if $it_is_xnet}
-{assign var=index value="listes.php"}
-{assign var=prefix value="listes-"}
-{else}
-{assign var=index value="index.php"}
-{assign var=prefix value=""}
-{/if}
-
 <table>
   <tr>
     <td colspan='2'>
-      [<a href='{$index}'>Voir toutes les listes</a>]
+      [<a href='{rel}/{$platal->ns}lists'>Voir toutes les listes</a>]
     </td>
   </tr>
   <tr>
-    <td><strong>Liste {$smarty.request.liste} :</strong></td>
+    <td><strong>Liste {$platal->argv[1]} :</strong></td>
     <td>
       {if $on neq members}
-      [<a href='{$prefix}members.php?liste={$smarty.request.liste}'>liste des membres</a>]
+      [<a href='{rel}/{$platal->ns}lists/members/{$platal->argv[1]}'>liste des membres</a>]
       {else}
       [liste des membres]
       {/if}
       {if !$it_is_xnet}
       {if $on neq trombi}
-      [<a href='{$prefix}trombi.php?liste={$smarty.request.liste}'>trombinoscope</a>]
+      [<a href='{rel}/{$platal->ns}lists/trombi/{$platal->argv[1]}'>trombinoscope</a>]
       {else}
       [trombinoscope]
       {/if}
       {/if}
       {if $on neq archives}
-      [<a href='{$prefix}archives.php?liste={$smarty.request.liste}'>archives</a>]
+      [<a href='{rel}/{$platal->ns}lists/archives/{$platal->argv[1]}'>archives</a>]
       {else}
       [archives]
       {/if}
     <td><strong>Administrer la liste :</strong></td>
     <td>
       {if $on neq moderate}
-      [<a href='{$prefix}moderate.php?liste={$smarty.get.liste}'>modération</a>]
+      [<a href='{rel}/{$platal->ns}lists/moderate/{$platal->argv[1]}'>modération</a>]
       {else}
       [modération]
       {/if}
       {if $on neq admin}
-      [<a href='{$prefix}admin.php?liste={$smarty.get.liste}'>ajout/retrait de membres</a>]
+      [<a href='{rel}/{$platal->ns}lists/admin/{$platal->argv[1]}'>ajout/retrait de membres</a>]
       {else}
       [ajout/retrait de membres]
       {/if}
       {if $on neq options}
-      [<a href='{$prefix}options.php?liste={$smarty.get.liste}'>options</a>]
+      [<a href='{rel}/{$platal->ns}lists/options/{$platal->argv[1]}'>options</a>]
       {else}
       [options]
       {/if}
       {if $on neq delete}
-      [<a href='{$prefix}delete.php?liste={$smarty.get.liste}'>détruire</a>]
+      [<a href='{rel}/{$platal->ns}lists/delete/{$platal->argv[1]}'>détruire</a>]
       {else}
       [détruire liste]
       {/if}
     <td><strong>Administrer (avancé) :</strong></td>
     <td>
       {if $on neq soptions}
-      [<a href='{$prefix}soptions.php?liste={$smarty.get.liste}'>options avancées</a>]
+      [<a href='{rel}/{$platal->ns}lists/soptions/{$platal->argv[1]}'>options avancées</a>]
       {else}
       [options avancées]
       {/if}
       {if $on neq check}
-      [<a href='{$prefix}check.php?liste={$smarty.get.liste}'>vérifications</a>]
+      [<a href='{rel}/{$platal->ns}lists/check/{$platal->argv[1]}'>vérifications</a>]
       {else}
       [vérifications]
       {/if}
   <tr>
     <td><strong>Synchroniser</strong></td>
     {if $on neq sync}
-    <td>[<a href="listes-sync.php?liste={$smarty.get.liste}">Synchroniser avec l'annuaire</a>]</td>
+    <td>[<a href="{rel}/{$platal->ns}lists/sync/{$platal->argv[1]}">Synchroniser avec l'annuaire</a>]</td>
     {else}
     <td>[Synchroniser avec l'annuaire]</td>
     {/if}
index dfdcb2e..4547a8a 100644 (file)
 
 <p>
 Pour t'inscrire à une liste il suffit de cliquer sur l'icone
-<img src="{"images/ajouter.gif"|url}" alt="[ inscription ]" /> située en fin de ligne.
+<img src="{rel}/images/ajouter.gif" alt="[ inscription ]" /> située en fin de ligne.
 </p>
 
 <p>
 Certaines listes sont à inscription modérée, l'inscription n'y est pas
 immédiate.  Il faut en effet l'action d'un modérateur de la liste pour valider
 (ou éventuellement refuser) ta candidature.  Ces listes apparaissent avec l'icone 
-<img src="{"images/flag.png"|url}" alt="[ en cours ]" />.
+<img src="{rel}/images/flag.png" alt="[ en cours ]" />.
 </p>
 
 <p>
 Pour se désinscrire, il suffit de la même manière de cliquer sur l'icone
-<img src="{"images/retirer.gif"|url}" alt="[ désinscription ]" />.
+<img src="{rel}/images/retirer.gif" alt="[ désinscription ]" />.
 </p>
 
 <h2>La diffusion sur une liste de diffusion</h2>
@@ -69,7 +69,8 @@ moyen pratique et efficace de rassembler plusieurs personnes autour d'un projet
 thématique particulière.
 </p>
 <p>
-Tu peux demander <a href='create.php'>la création</a> d'une liste de diffusion sur le thème de ton choix.  
+Tu peux demander <a href='{rel}/lists/create'>la création</a>
+d'une liste de diffusion sur le thème de ton choix.  
 </p>
 
 
@@ -95,7 +96,7 @@ Si tu te d
 
 <br />
 
-<form method='post' action='{$smarty.server.REQUEST_URI}'>
+<form method='post' action='{rel}/lists'>
   <table class='tinybicol' cellspacing='0' cellpadding='2'>
     <tr>
       <th colspan='2'>Inscription à une liste de diffusion promo</th>
index 01f2baa..df0ec23 100644 (file)
@@ -33,7 +33,7 @@
   {if $liste.priv eq $priv}
   <tr class='{cycle values="impair,pair"}'>
     <td>
-      <a href='members.php?liste={$liste.list}'>{$liste.list}{if $liste.own}&nbsp;*{/if}</a> 
+      <a href='{rel}/{$platal->ns}lists/members/{$liste.list}'>{$liste.list}{if $liste.own}&nbsp;*{/if}</a> 
     </td>
     <td>{$liste.desc}</td>
     <td class='center'>
     <td class='right'>{$liste.nbsub}</td>
     <td class='right'>
       {if $liste.sub eq 2}
-      <a href='{$smarty.server.PHP_SELF}?del={$liste.list}'>
-        <img src="{"images/retirer.gif"|url}" alt="[ désinscription ]" title="me désinscrire de {$liste.list}" />
+      <a href='{rel}/{$platal->ns}lists?del={$liste.list}'>
+        <img src="{rel}/images/retirer.gif" alt="[ désinscription ]" title="me désinscrire de {$liste.list}" />
       </a>
       {elseif $liste.sub eq 1}
-      <img src="{"images/flag.png"|url}" alt="[ en cours ]" title='inscription en attente de modération' />
+      <img src="{rel}/images/flag.png" alt="[ en cours ]" title='inscription en attente de modération' />
       {else}
-      <a href='{$smarty.server.PHP_SELF}?add={$liste.list}'>
-        <img src="{"images/ajouter.gif"|url}" alt="[ inscription ]" title="m'inscrire sur {$liste.list}" />
+      <a href='{rel}/{$platal->ns}lists?add={$liste.list}'>
+        <img src="{rel}/images/ajouter.gif" alt="[ inscription ]" title="m'inscrire sur {$liste.list}" />
       </a>
       {/if}
     </td>
index 5178b2a..831a5c0 100644 (file)
@@ -24,7 +24,7 @@
 {include file="listes/header_listes.tpl" on=members}
 
 <h1>
-  Liste {$smarty.request.liste}
+  Liste {$platal->argv[1]}
 </h1>
 
 <table class='tinybicol' cellpadding='0' cellspacing='0'>
       {if $details.sub>1}
       Tu es inscrit sur la liste.<br />
       Te désinscrire :
-      <a href='?liste={$smarty.request.liste}&amp;del=1'><img src="{rel}/images/retirer.gif" alt="[me désinsiscrire]" /></a>
+      <a href='{rel}/{$platal->ns}lists/members/{$platal->argv[1]}?del=1'><img src="{rel}/images/retirer.gif" alt="[me désinsiscrire]" /></a>
       {elseif $details.sub eq 1}
       Ta demande d'inscription est en cours de validation.
       {else}
       Tu n'es pas inscrit.<br />
       Demander ton inscription :
-      <a href="?liste={$smarty.request.liste}&amp;add=1"><img src="{rel}/images/ajouter.gif" alt="[demander mon inscription]" /></a>
+      <a href="{rel}/{$platal->ns}lists/members/{$platal->argv[1]}?add=1"><img src="{rel}/images/ajouter.gif" alt="[demander mon inscription]" /></a>
       {/if}
     </td>
   </tr>
 <h1>
   membres de la liste
   {if $smarty.get.alpha}
-  (<a href='?liste={$smarty.request.liste}'>trier par promo</a>)
+  (<a href='{rel}/{$platal->ns}lists/members/{$platal->argv[1]}'>trier par promo</a>)
   {else}
-  (<a href='?liste={$smarty.request.liste}&amp;alpha=1'>trier par nom</a>)
+  (<a href='{rel}/{$platal->ns}lists/members/{$platal->argv[1]}?alpha=1'>trier par nom</a>)
   {/if}
 </h1>
 
     <td>
       {foreach from=$xs item=x}
       {if $promo}
-      <a href="{"fiche.php"|url}?user={$x.l}" class="popup2">{$x.n}</a><br />
+      <a href="{rel}/profile/{$x.l}" class="popup2">{$x.n}</a><br />
       {else}
       {$x.l}<br />
       {/if}
index 9326ebd..d89c26b 100644 (file)
@@ -42,8 +42,8 @@
     </td>
     <td>{$s.addr}</td>
     <td class='action'>
-      <a href='?liste={$smarty.request.liste}&amp;sadd={$s.id}'>ajouter</a>
-      <a href='?liste={$smarty.request.liste}&amp;sid={$s.id}'>refuser</a>
+      <a href='{rel}/{$platal->ns}lists/moderate/{$platal->argv[1]}?sadd={$s.id}'>ajouter</a>
+      <a href='{rel}/{$platal->ns}lists/moderate/{$platal->argv[1]}?sid={$s.id}'>refuser</a>
     </td>
   </tr>
   {/foreach}
   <strong>détruire:</strong> le mail est effacé sans autre forme de procès.
   N'utiliser <strong>QUE</strong> pour les virus et les courriers indésirables. <br/>
   S'il y a trop d'indésirables, il est probablement plus rapide pour la suite de les
-  {if $it_is_xnet}
-  {assign var=prefix value="listes-"}
-  {else}
-  {assign var=prefix value=""}
-  {/if}
-  <a href="{$prefix}options.php?liste={$smarty.request.liste}#antispam">jeter directement</a> et non de les modérer. 
+  <a href="{rel}/{$platal->ns}lists/options/{$platal->argv[1]}#antispam">jeter directement</a> et non de les modérer. 
   </li>
 </ul>
 
@@ -94,8 +89,8 @@
     <td class='right'>{$m.size}o</td>
     <td class='right'>{$m.stamp|date_format:"%X<br />%x"}</td>
     <td class='action'>
-      <a href='?liste={$smarty.request.liste}&amp;mid={$m.id}'>voir</a><br/>
-      <a href='?liste={$smarty.request.liste}&amp;mid={$m.id}&amp;mok=1'>accepter</a>&nbsp;<a href='?liste={$smarty.request.liste}&amp;mid={$m.id}&amp;mdel=1'>détruire</a></td>
+      <a href='{rel}/{$platal->ns}lists/moderate/{$platal->argv[1]}?mid={$m.id}'>voir</a><br/>
+      <a href='{rel}/{$platal->ns}lists/moderate/{$platal->argv[1]}?mid={$m.id}&amp;mok=1'>accepter</a>&nbsp;<a href='{rel}/{$platal->ns}lists/moderate/{$platal->argv[1]}?mid={$m.id}&amp;mdel=1'>détruire</a></td>
   </tr>
   {/foreach}
 </table>
index b4c4ac2..5108e11 100644 (file)
@@ -60,7 +60,7 @@
 <br />
 {/if}
 
-<form method='post' action='?liste={$smarty.request.liste}'>
+<form method='post' action='{rel}/{$platal->ns}lists/moderate/{$platal->argv[1]}'>
   <table class='tinybicol' cellpadding='0' cellspacing='0'>
     <tr>
       <th class='titre'>Modérer le mail</th>
index 139f2a3..f3d32bc 100644 (file)
@@ -25,7 +25,7 @@
   Refuser l'inscription d'un utilisateur
 </h1>
 
-<form method='post' action='?liste={$smarty.request.liste}'>
+<form method='post' action='{rel}/{$platal->ns}lists/moderate/{$platal->argv[1]}'>
   <table class='tinybicol' cellpadding='0' cellspacing='0'>
     <tr>
       <th class='titre'>refuser l'inscription de :</th>
index 28a2c45..84442ab 100644 (file)
@@ -33,7 +33,7 @@ Tu n'es pas administrateur de la liste, mais du site.
   Changer les options de la liste {$details.addr}
 </h1>
 
-<form method='post' action='{$smarty.server.REQUEST_URI}'>
+<form method='post' action='{rel}/{$platal->ns}lists/options/{$platal->argv[1]}'>
   <table class='bicol' cellpadding='2' cellspacing='0'>
     <tr><th colspan='2'>Options de la liste {$details.addr}</th></tr>
     <tr class='impair'>
@@ -159,14 +159,14 @@ les X inscrits 
 redirection en mode 'inactif'. le logiciel de mailing list saura se débrouiller tout seul.
 </p>
 
-<form method='post' action='{$smarty.server.REQUEST_URI}'>
+<form method='post' action='{rel}/{$platal->ns}lists/options/{$platal->argv[1]}'>
   <table class='tinybicol' cellpadding='2' cellspacing='0'>
     <tr><th>Addresses non modérées</th></tr>
     <tr>
       <td>
         {if $options.accept_these_nonmembers|@count}
         {foreach from=$options.accept_these_nonmembers item=addr}
-        {$addr}<a href='?liste={$smarty.get.liste}&amp;atn_del={$addr}'>
+        {$addr}<a href='{rel}/{$platal->ns}lists/options/{$platal->argv[1]}&amp;atn_del={$addr}'>
           <img src='{"images/retirer.gif"|url}' alt='retirer de la whitelist' title="retirer {$addr} de la whitelist" />
         </a><br />
         {/foreach}
index 938a0a1..780a42f 100644 (file)
@@ -27,7 +27,7 @@
   Changer les options de la liste {$details.addr}
 </h1>
 
-<form method='post' action='{$smarty.server.REQUEST_URI}'>
+<form method='post' action='{rel}/{$platal->ns}lists/soptions/{$platal->argv[1]}'>
   <table class='bicol' cellpadding='2' cellspacing='0'>
     <tr><th colspan='2'>Options de la liste {$details.addr}</th></tr>
     <tr class='impair'>
index 1f98e0c..951d51f 100644 (file)
@@ -24,7 +24,7 @@
 {include file="listes/header_listes.tpl" on=trombi}
 
 <h1>
-  Liste {$smarty.request.liste}
+  Liste {$platal->argv[1]}
 </h1>
 
 <table class='tinybicol' cellpadding='0' cellspacing='0'>
       {if $details.sub>1}
       Tu es inscrit sur la liste.<br />
       Te désinscrire :
-      <a href='?liste={$smarty.request.liste}&amp;del=1'><img src="{rel}/images/retirer.gif" alt="[me désinsiscrire]" /></a>
+      <a href='{rel}/{$platal->ns}trombi/{$platal->argv[1]}?del=1'><img src="{rel}/images/retirer.gif" alt="[me désinsiscrire]" /></a>
       {elseif $details.sub eq 1}
       Ta demande d'inscription est en cours de validation.
       {else}
       Tu n'es pas inscrit.<br />
       Demander ton inscription :
-      <a href="?liste={$smarty.request.liste}&amp;add=1"><img src="{rel}/images/ajouter.gif" alt="[demander mon inscription]" /></a>
+      <a href="{rel}/{$platal->ns}trombi/{$platal->argv[1]}?add=1"><img src="{rel}/images/ajouter.gif" alt="[demander mon inscription]" /></a>
       {/if}
     </td>
   </tr>