rework some things
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Mon, 25 Apr 2005 14:35:41 +0000 (14:35 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:28:43 +0000 (23:28 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-588

18 files changed:
htdocs.net/groupe/alias-admin.php
htdocs.net/groupe/alias-create.php
htdocs.net/groupe/annuaire.php
htdocs.net/groupe/asso.php
htdocs.net/groupe/inscrire.php
htdocs.net/groupe/listes-admin.php
htdocs.net/groupe/listes-archives.php
htdocs.net/groupe/listes-check.php
htdocs.net/groupe/listes-create.php
htdocs.net/groupe/listes-delete.php
htdocs.net/groupe/listes-members.php
htdocs.net/groupe/listes-moderate.php
htdocs.net/groupe/listes-options.php
htdocs.net/groupe/listes-soptions.php
htdocs.net/groupe/listes.php
htdocs.net/groupe/telepaiement.php
include/xnet/page.inc.php
templates/xnet/groupe/asso.tpl

index 71f1950..2ef9b37 100644 (file)
@@ -2,8 +2,6 @@
 require 'xnet.inc.php';
 
 new_groupadmin_page('xnet/groupe/alias-admin.tpl');
-$page->useMenu();
-$page->setType($globals->asso('cat'));
 
 if (!Get::has('liste')) {
     header("Location: listes.php");
index 7094998..b41d86d 100644 (file)
@@ -2,10 +2,6 @@
 require 'xnet.inc.php';
 
 new_groupadmin_page('xnet/groupe/alias-create.tpl');
-$page->useMenu();
-$page->setType($globals->asso('cat'));
-
-$page->assign('asso', $globals->asso());
 
 if(Post::has('submit')) {
     if (!Post::has('liste')) {
index 9299760..0330b97 100644 (file)
@@ -2,10 +2,7 @@
 require 'xnet.inc.php';
 
 new_group_page('xnet/groupe/annuaire.tpl');
-$page->setType($globals->asso('cat'));
-$page->assign('asso', $globals->asso());
 $page->assign('admin', may_update());
-$page->useMenu();
 
 $tri = (Env::get('order') == 'alpha' ? 'promo, nom, prenom' : 'nom, prenom, promo');
 $res = $globals->xdb->iterRow(
index b86c465..3d85ec8 100644 (file)
@@ -3,13 +3,13 @@
 require 'xnet.inc.php';
 
 new_page('xnet/groupe/asso.tpl', AUTH_PUBLIC);
+$page->useMenu();
+$page->setType($globals->asso('cat'));
+
+$page->assign('asso', $globals->asso());
 if (!$globals->asso('id')) {
     header("Location: ../");
 }
-$page->useMenu();
-$page->setType(strtolower($globals->asso('cat')));
-$page->assign('asso', $globals->asso());
-
 // Sélection de toutes les associations ayant la même catégorie et le même domaine que l'activité sélectionnée
 $gps = $globals->xdb->iterator(
         "SELECT  diminutif, nom
index 81f407f..9560084 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 require 'xnet.inc.php';
 
-new_page('xnet/groupe/inscrire.tpl', AUTH_PUBLIC);
+new_page('xnet/groupe/inscrire.tpl', AUTH_MDP);
 $page->useMenu();
 $page->setType($globals->asso('cat'));
 $page->assign('asso', $globals->asso());
index 30e719f..bfd9196 100644 (file)
@@ -24,8 +24,6 @@ if (!Env::has('liste')) header('Location: listes.php');
 $liste = strtolower(Env::get('liste'));
 
 new_group_page('listes/admin.tpl');
-$page->setType($globals->asso('cat'));
-$page->useMenu();
 
 require_once('lists.inc.php');
 $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
index 15b1c70..61597ed 100644 (file)
@@ -24,8 +24,6 @@ if (!Env::has('liste')) header('Location: listes.php');
 $liste = strtolower(Env::get('liste'));
 
 new_group_page('listes/archives.tpl');
-$page->setType($globals->asso('cat'));
-$page->useMenu();
 
 require_once('lists.inc.php');
 $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
index f5f8465..57bb6bc 100644 (file)
@@ -24,8 +24,6 @@ if (!Env::has('liste')) header('Location: index.php');
 $liste = strtolower(Env::get('liste'));
 
 new_admin_page('listes/check.tpl');
-$page->setType($globals->asso('cat'));
-$page->useMenu();
 
 require_once('lists.inc.php');
 $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
index b65208a..509f1ae 100644 (file)
@@ -2,9 +2,6 @@
 require 'xnet.inc.php';
 
 new_groupadmin_page('xnet/groupe/listes-create.tpl');
-$page->useMenu();
-$page->setType($globals->asso('cat'));
-$page->assign('asso', $globals->asso());
 
 if (Post::has('submit')) {
     if (!Post::has('liste')) {
index e6dc9aa..afbe451 100644 (file)
@@ -24,8 +24,6 @@ if (!Env::has('liste')) header('Location: listes.php');
 $liste = strtolower(Env::get('liste'));
 
 new_group_page('listes/delete.tpl');
-$page->setType($globals->asso('cat'));
-$page->useMenu();
 
 require_once('lists.inc.php');
 $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
index 117aa84..d16c508 100644 (file)
@@ -24,8 +24,6 @@ if (!Env::has('liste')) header('Location: listes.php');
 $liste = strtolower(Env::get('liste'));
 
 new_group_page('listes/members.tpl');
-$page->setType($globals->asso('cat'));
-$page->useMenu();
 
 require_once('lists.inc.php');
 $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
index 5a2e906..44a660e 100644 (file)
@@ -28,8 +28,6 @@ if (preg_match("!(?:[a-z0-9]+\\.)?{".$globals->asso('mail_domain')."}_(.*)!", $l
 }
 
 new_group_page('listes/moderate.tpl');
-$page->setType($globals->asso('cat'));
-$page->useMenu();
 
 require_once('lists.inc.php');
 $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
index b16c004..3667754 100644 (file)
@@ -24,8 +24,6 @@ if (!Env::has('liste')) header('Location: listes.php');
 $liste = strtolower(Env::get('liste'));
 
 new_group_page('listes/options.tpl');
-$page->setType($globals->asso('cat'));
-$page->useMenu();
 
 require_once('lists.inc.php');
 $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
index a61d5b9..cea1523 100644 (file)
@@ -24,8 +24,6 @@ if (!Env::has('liste')) header('Location: listes.php');
 $liste = strtolower(Env::get('liste'));
 
 new_admin_page('listes/soptions.tpl');
-$page->setType($globals->asso('cat'));
-$page->useMenu();
 
 require_once('lists.inc.php');
 $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
index 20715c2..7bc1aa8 100644 (file)
@@ -3,9 +3,6 @@
 require_once 'xnet.inc.php';
 
 new_group_page('xnet/groupe/listes.tpl');
-$page->setType($globals->asso('cat'));
-$page->useMenu();
-$page->assign('asso', $globals->asso());
 
 require_once('lists.inc.php');
 $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
index 9410b73..5527c99 100644 (file)
@@ -3,9 +3,6 @@
 require 'xnet.inc.php';
 
 new_group_page('xnet/groupe/telepaiement.tpl');
-$page->setType($globals->asso('cat'));
-$page->useMenu();
-$page->assign('asso', $globals->asso());
 
 $res = $globals->xdb->query("SELECT id, text FROM {$globals->money->mpay_tprefix}paiements WHERE asso_id = {?}", $globals->asso('id'));
 $tit = $res->fetchAllAssoc();
index e0dbcc5..f821395 100644 (file)
@@ -91,7 +91,7 @@ class XnetPage extends PlatalPage
 
         if (logged() && may_update()) {
             $sub = array();
-            $sub['modifier l\'acceuil'] = "$dim/editer.php";
+            $sub['modifier l\'acceuil'] = "$dim/edit.php";
             $sub['envoyer un mail']     = "$dim/mail.php";
             $sub['créer une liste']     = "$dim/listes-create.php";
             $sub['créer un alias']      = "$dim/alias-create.php";
@@ -145,19 +145,25 @@ class XnetAuth extends XnetPage
 }
 
 // }}}
-// {{{ class XnetGroupPage
+// {{{ class XnetAdmin
 
 /** Une classe pour les pages réservées aux admins (authentifiés!).
  */
-class XnetGroupPage extends XnetAuth
+class XnetAdmin extends XnetAuth
 {
     // {{{ function XnetAdmin()
     
-    function XnetGroupPage($tpl, $type=SKINNED)
+    function XnetAdmin($tpl, $type=SKINNED)
     {
+        global $globals;
+        
         $this->XnetAuth($tpl, $type);
-        if (!is_member() && !has_perms()) {
-            $this->kill("You have not sufficient credentials");
+        check_perms();
+
+        $this->useMenu();
+        if ($globals->asso('cat')) {
+            $this->assign('asso', $globals->asso());
+            $this->setType($globals->asso('cat'));
         }
     }
     
@@ -165,38 +171,52 @@ class XnetGroupPage extends XnetAuth
 }
 
 // }}}
-// {{{ class XnetGroupAdmin
+// {{{ class XnetGroupPage
 
 /** Une classe pour les pages réservées aux admins (authentifiés!).
  */
-class XnetGroupAdmin extends XnetAuth
+class XnetGroupPage extends XnetAuth
 {
     // {{{ function XnetAdmin()
     
-    function XnetGroupAdmin($tpl, $type=SKINNED)
+    function XnetGroupPage($tpl, $type=SKINNED)
     {
+        global $globals;
+
         $this->XnetAuth($tpl, $type);
-        if (!may_update()) {
+        if (!is_member() && !has_perms()) {
             $this->kill("You have not sufficient credentials");
         }
+
+        $this->useMenu();
+        $this->assign('asso', $globals->asso());
+        $this->setType($globals->asso('cat'));
     }
     
     // }}}
 }
 
 // }}}
-// {{{ class XnetAdmin
+// {{{ class XnetGroupAdmin
 
 /** Une classe pour les pages réservées aux admins (authentifiés!).
  */
-class XnetAdmin extends XnetAuth
+class XnetGroupAdmin extends XnetAuth
 {
     // {{{ function XnetAdmin()
     
-    function XnetAdmin($tpl, $type=SKINNED)
+    function XnetGroupAdmin($tpl, $type=SKINNED)
     {
+        global $globals;
+        
         $this->XnetAuth($tpl, $type);
-        check_perms();
+        if (!may_update()) {
+            $this->kill("You have not sufficient credentials");
+        }
+
+        $this->useMenu();
+        $this->assign('asso', $globals->asso());
+        $this->setType($globals->asso('cat'));
     }
     
     // }}}
index 5ccc122..3c7866f 100644 (file)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
 
+<h1>{$asso.nom} : Accueil</h1>
+
 <table id="content" cellpadding="0" cellspacing="0">
   <tr>
-    <td colspan="2">
-      <h1>
-        <a class="s" href="../groupes.php?cat={$asso.cat}">{$asso.cat}</a>
-        {if $asso.dom}&gt;
-        <a class="s" href="../groupes.php?cat={$asso.cat}&amp;dom={$asso.dom}">{$asso.domnom}</a>
-        {/if}
-        &gt; {$asso.nom} : Accueil
-      </h1>
-    </td>
-  </tr>
-  <tr>
     <td>
       {if $asso.site}
       <a href="{$asso.site}"><img src='getlogo.php' alt="LOGO" /></a>