now learn what code sharing is !
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Mon, 18 Apr 2005 13:11:04 +0000 (13:11 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:28:38 +0000 (23:28 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-567

htdocs.net/groupe/listes-options.php [new file with mode: 0644]
htdocs/listes/options.php
include/platal/page.inc.php
include/xnet/page.inc.php
templates/listes/header_listes.tpl
templates/xnet/skin.tpl

diff --git a/htdocs.net/groupe/listes-options.php b/htdocs.net/groupe/listes-options.php
new file mode 100644 (file)
index 0000000..d1e4496
--- /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/options.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/options.php');
+
+?>
index cae85f5..b58e4b4 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/options.tpl', AUTH_MDP);
-require_once('lists.inc.php');
+    new_skinned_page('listes/options.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 (Post::has('submit')) {
     $values = $_POST;
index 48cf158..0e54af0 100644 (file)
@@ -23,7 +23,7 @@ require_once('diogenes/diogenes.core.page.inc.php');
 require_once('platal/errors.inc.php');
 require_once('platal/smarty.plugins.inc.php');
 
-// {{{ class XorgPage
+// {{{ class PlatalPage
 
 class PlatalPage extends DiogenesCorePage
 {
@@ -39,7 +39,7 @@ class PlatalPage extends DiogenesCorePage
     var $use_sub_dirs     = false;
 
     // }}}
-    // {{{ function XorgPage()
+    // {{{ function PlatalPage()
 
     function PlatalPage($tpl, $type=SKINNED)
     {
index 1ac7156..0d235dd 100644 (file)
@@ -20,6 +20,7 @@
  ***************************************************************************/
 
 require_once('platal/page.inc.php');
+require_once('xnet/smarty.plugins.inc.php');
 
 // {{{ class XnetPage
 
@@ -29,13 +30,11 @@ class XnetPage extends PlatalPage
 
     function XnetPage($tpl, $type=SKINNED)
     {
-        global $globals;
         $this->PlatalPage($tpl, $type);
+        $this->register_function('list_all_my_groups', 'list_all_my_groups');
         if (Get::has('auth')) {
             $_SESSION['session']->doAuthX($this);
         }
-        require_once('xnet/smarty.plugins.inc.php');
-        $this->register_function('list_all_my_groups', 'list_all_my_groups');
     }
 
     // }}}
@@ -85,6 +84,7 @@ class XnetAuth extends XnetPage
 
     function doAuth()
     {
+        $this->register_function('list_all_my_groups', 'list_all_my_groups');
         $_SESSION['session']->doAuth($this);
     }
     
@@ -92,6 +92,24 @@ class XnetAuth extends XnetPage
 }
 
 // }}}
+// {{{ class XnetAdmin
+
+/** Une classe pour les pages réservées aux admins (authentifiés!).
+ */
+class XnetAdmin extends XnetAuth
+{
+    // {{{ function XnetAdmin()
+    
+    function XnetAdmin($tpl, $type=SKINNED)
+    {
+        $this->XnetAuth($tpl, $type);
+        check_perms();
+    }
+    
+    // }}}
+}
+
+// }}}
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
 ?>
index f8ca6d4..7d6a423 100644 (file)
@@ -1,6 +1,6 @@
 {***************************************************************************
  *  Copyright (C) 2003-2004 Polytechnique.org                              *
- *  http ://opensource.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   *
@@ -22,7 +22,7 @@
 <table>
   <tr>
     <td colspan='2'>
-      [<a href='index.php'>Voir toutes les listes</a>]
+      [<a href='{$ml_index|default:"index.php"}'>Voir toutes les listes</a>]
     </td>
   </tr>
   <tr>
index 947e71d..d4e41aa 100644 (file)
       {else}
       <tr id="top">
         <td>
-          <img src="images/logo.png" alt="LOGO Assos" />
+          <img src="{rel}/images/logo.png" alt="LOGO Assos" />
         </td>
         <td colspan="3" style="text-align: right">
-          <a href="https://www.polytechnique.org/"><img src="images/logo-xorg.png" alt="LOGO X.Org" /></a>
-          <img src="images/asso2.png" alt="titre_du_site" />
+          <a href="https://www.polytechnique.org/"><img src="{rel}/images/logo-xorg.png" alt="LOGO X.Org" /></a>
+          <img src="{rel}/images/asso2.png" alt="titre_du_site" />
         </td>
       </tr>
       <tr><td colspan="4"><img src="{rel}/images/barre.png" alt="----------" width="765" /></td></tr>