listes-admin + adjustments wrt xnet/xorg duality
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Mon, 18 Apr 2005 13:27:41 +0000 (13:27 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:28:39 +0000 (23:28 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-568

htdocs.net/groupe/listes-admin.php [new file with mode: 0644]
htdocs.net/images/retirer.gif [new symlink]
htdocs/listes/admin.php
include/xnet/page.inc.php
templates/listes/admin.tpl
templates/listes/header_listes.tpl

diff --git a/htdocs.net/groupe/listes-admin.php b/htdocs.net/groupe/listes-admin.php
new file mode 100644 (file)
index 0000000..4172c83
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/***************************************************************************
+ *  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                *
+ ***************************************************************************/
+
+require_once 'xnet.inc.php';
+if (!Env::has('liste')) header('Location: listes.php');
+$liste = strtolower(Env::get('liste'));
+
+new_skinned_page('listes/admin.tpl', AUTH_MDP);
+$page->setType($globals->asso('cat'));
+$page->useMenu();
+$page->assign('ml_index', 'listes.php');
+
+require_once('lists.inc.php');
+$client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
+require(dirname(dirname(dirname(__FILE__))).'/htdocs/listes/admin.php');
+
+?>
diff --git a/htdocs.net/images/retirer.gif b/htdocs.net/images/retirer.gif
new file mode 120000 (symlink)
index 0000000..dea5bf7
--- /dev/null
@@ -0,0 +1 @@
+../../htdocs/images/retirer.gif
\ No newline at end of file
index bb8edaa..59d7814 100644 (file)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-require_once("xorg.inc.php");
-if (!Env::has('liste')) header('Location: index.php');
-$liste = strtolower(Env::get('liste'));
+if (!$page) {
+    require_once("xorg.inc.php");
+    if (!Env::has('liste')) header('Location: index.php');
+    $liste = strtolower(Env::get('liste'));
 
-new_skinned_page('listes/admin.tpl', AUTH_MDP);
-require_once('lists.inc.php');
+    new_skinned_page('listes/admin.tpl', AUTH_MDP);
+    require_once('lists.inc.php');
 
-$client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
+    $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
+}
 
 if (Env::has('add_member')) {
     require_once('user.func.inc.php');
index 0d235dd..8c194eb 100644 (file)
@@ -31,10 +31,6 @@ class XnetPage extends PlatalPage
     function XnetPage($tpl, $type=SKINNED)
     {
         $this->PlatalPage($tpl, $type);
-        $this->register_function('list_all_my_groups', 'list_all_my_groups');
-        if (Get::has('auth')) {
-            $_SESSION['session']->doAuthX($this);
-        }
     }
 
     // }}}
@@ -62,6 +58,16 @@ class XnetPage extends PlatalPage
     }
 
     // }}}
+    // {{{ function doAuth()
+
+    function doAuth()
+    {
+        $this->register_function('list_all_my_groups', 'list_all_my_groups');
+        $this->assign('it_is_xnet', true);
+        if (Get::has('auth')) {
+            $_SESSION['session']->doAuthX($this);
+        }
+    }
 }
 
 // }}}
@@ -84,7 +90,7 @@ class XnetAuth extends XnetPage
 
     function doAuth()
     {
-        $this->register_function('list_all_my_groups', 'list_all_my_groups');
+        parent::doAuth();
         $_SESSION['session']->doAuth($this);
     }
     
index b62f9dc..9120c33 100644 (file)
@@ -30,7 +30,7 @@ Tu n'es pas administrateur de la liste, mais du site.
 <p>
 Pour inscrire un utilisateur, il faut remplir les champs prévus à cet effet en saisissant
 son identifiant, de la forme "prenom.nom", ou "prenom.nom.promo" en cas d'homonymie.
-L'icône <img src='{"images/retirer.gif"|url}' alt='retirer membre' title='retirer membre' /> permet de désinscrire de la liste quelqu'un
+L'icône <img src='{rel}/images/retirer.gif' alt='retirer membre' title='retirer membre' /> permet de désinscrire de la liste quelqu'un
 qui y était abonné.
 </p>
 
@@ -50,7 +50,7 @@ qui y 
         {else}
         {$x.l}
         {/if}
-        <a href='?liste={$smarty.get.liste}&amp;del_owner={$x.l}'><img src='{"images/retirer.gif"|url}' alt='retirer modérateur' title='retirer modérateur' /></a>
+        <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>
         <br />
         {/foreach}
       </td>
@@ -84,7 +84,7 @@ qui y 
         {else}
         {$x.l}
         {/if}
-        <a href='?liste={$smarty.get.liste}&amp;del_member={$x.l}'><img src='{"images/retirer.gif"|url}' alt='retirer membre' title='retirer membre' /></a>
+        <a href='?liste={$smarty.get.liste}&amp;del_member={$x.l}'><img src='{rel}/images/retirer.gif' alt='retirer membre' title='retirer membre' /></a>
         <br />
         {/foreach}
       </td>
index 7d6a423..682672c 100644 (file)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
 
+{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='{$ml_index|default:"index.php"}'>Voir toutes les listes</a>]
+      [<a href='{$index}'>Voir toutes les listes</a>]
     </td>
   </tr>
   <tr>
     <td><strong>Liste {$smarty.request.liste} :</strong></td>
     <td>
       {if $on neq members}
-      [<a href='members.php?liste={$smarty.request.liste}'>liste des membres</a>]
+      [<a href='{$prefix}members.php?liste={$smarty.request.liste}'>liste des membres</a>]
       {else}
       [liste des membres]
       {/if}
       {if $on neq trombi}
-      [<a href='trombi.php?liste={$smarty.request.liste}'>trombinoscope</a>]
+      [<a href='{$prefix}trombi.php?liste={$smarty.request.liste}'>trombinoscope</a>]
       {else}
       [trombinoscope]
       {/if}
       {if $on neq archives}
-      [<a href='archives.php?liste={$smarty.request.liste}'>archives</a>]
+      [<a href='{$prefix}archives.php?liste={$smarty.request.liste}'>archives</a>]
       {else}
       [archives]
       {/if}
     <td><strong>Administrer la liste :</strong></td>
     <td>
       {if $on neq moderate}
-      [<a href='moderate.php?liste={$smarty.get.liste}'>modération</a>]
+      [<a href='{$prefix}moderate.php?liste={$smarty.get.liste}'>modération</a>]
       {else}
       [modération]
       {/if}
       {if $on neq admin}
-      [<a href='admin.php?liste={$smarty.get.liste}'>ajout/retrait de membres</a>]
+      [<a href='{$prefix}admin.php?liste={$smarty.get.liste}'>ajout/retrait de membres</a>]
       {else}
       [ajout/retrait de membres]
       {/if}
       {if $on neq options}
-      [<a href='options.php?liste={$smarty.get.liste}'>options</a>]
+      [<a href='{$prefix}options.php?liste={$smarty.get.liste}'>options</a>]
       {else}
       [options]
       {/if}
       {if $on neq delete}
-      [<a href='delete.php?liste={$smarty.get.liste}'>détruire</a>]
+      [<a href='{$prefix}delete.php?liste={$smarty.get.liste}'>détruire</a>]
       {else}
       [détruire liste]
       {/if}
     <td><strong>Administrer (avancé) :</strong></td>
     <td>
       {if $on neq soptions}
-      [<a href='soptions.php?liste={$smarty.get.liste}'>options avancées</a>]
+      [<a href='{$prefix}soptions.php?liste={$smarty.get.liste}'>options avancées</a>]
       {else}
       [options avancées]
       {/if}
       {if $on neq check}
-      [<a href='check.php?liste={$smarty.get.liste}'>vérifications</a>]
+      [<a href='{$prefix}check.php?liste={$smarty.get.liste}'>vérifications</a>]
       {else}
       [vérifications]
       {/if}