From 41187d9fa78d262d0b561b6aa90fbfbe294ebf84 Mon Sep 17 00:00:00 2001 From: "Pierre Habouzit (MadCoder" Date: Mon, 25 Apr 2005 14:35:41 +0000 Subject: [PATCH] rework some things git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-588 --- htdocs.net/groupe/alias-admin.php | 2 -- htdocs.net/groupe/alias-create.php | 4 --- htdocs.net/groupe/annuaire.php | 3 --- htdocs.net/groupe/asso.php | 8 +++--- htdocs.net/groupe/inscrire.php | 2 +- htdocs.net/groupe/listes-admin.php | 2 -- htdocs.net/groupe/listes-archives.php | 2 -- htdocs.net/groupe/listes-check.php | 2 -- htdocs.net/groupe/listes-create.php | 3 --- htdocs.net/groupe/listes-delete.php | 2 -- htdocs.net/groupe/listes-members.php | 2 -- htdocs.net/groupe/listes-moderate.php | 2 -- htdocs.net/groupe/listes-options.php | 2 -- htdocs.net/groupe/listes-soptions.php | 2 -- htdocs.net/groupe/listes.php | 3 --- htdocs.net/groupe/telepaiement.php | 3 --- include/xnet/page.inc.php | 48 +++++++++++++++++++++++++---------- templates/xnet/groupe/asso.tpl | 13 ++-------- 18 files changed, 41 insertions(+), 64 deletions(-) diff --git a/htdocs.net/groupe/alias-admin.php b/htdocs.net/groupe/alias-admin.php index 71f1950..2ef9b37 100644 --- a/htdocs.net/groupe/alias-admin.php +++ b/htdocs.net/groupe/alias-admin.php @@ -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"); diff --git a/htdocs.net/groupe/alias-create.php b/htdocs.net/groupe/alias-create.php index 7094998..b41d86d 100644 --- a/htdocs.net/groupe/alias-create.php +++ b/htdocs.net/groupe/alias-create.php @@ -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')) { diff --git a/htdocs.net/groupe/annuaire.php b/htdocs.net/groupe/annuaire.php index 9299760..0330b97 100644 --- a/htdocs.net/groupe/annuaire.php +++ b/htdocs.net/groupe/annuaire.php @@ -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( diff --git a/htdocs.net/groupe/asso.php b/htdocs.net/groupe/asso.php index b86c465..3d85ec8 100644 --- a/htdocs.net/groupe/asso.php +++ b/htdocs.net/groupe/asso.php @@ -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 diff --git a/htdocs.net/groupe/inscrire.php b/htdocs.net/groupe/inscrire.php index 81f407f..9560084 100644 --- a/htdocs.net/groupe/inscrire.php +++ b/htdocs.net/groupe/inscrire.php @@ -1,7 +1,7 @@ useMenu(); $page->setType($globals->asso('cat')); $page->assign('asso', $globals->asso()); diff --git a/htdocs.net/groupe/listes-admin.php b/htdocs.net/groupe/listes-admin.php index 30e719f..bfd9196 100644 --- a/htdocs.net/groupe/listes-admin.php +++ b/htdocs.net/groupe/listes-admin.php @@ -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')); diff --git a/htdocs.net/groupe/listes-archives.php b/htdocs.net/groupe/listes-archives.php index 15b1c70..61597ed 100644 --- a/htdocs.net/groupe/listes-archives.php +++ b/htdocs.net/groupe/listes-archives.php @@ -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')); diff --git a/htdocs.net/groupe/listes-check.php b/htdocs.net/groupe/listes-check.php index f5f8465..57bb6bc 100644 --- a/htdocs.net/groupe/listes-check.php +++ b/htdocs.net/groupe/listes-check.php @@ -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')); diff --git a/htdocs.net/groupe/listes-create.php b/htdocs.net/groupe/listes-create.php index b65208a..509f1ae 100644 --- a/htdocs.net/groupe/listes-create.php +++ b/htdocs.net/groupe/listes-create.php @@ -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')) { diff --git a/htdocs.net/groupe/listes-delete.php b/htdocs.net/groupe/listes-delete.php index e6dc9aa..afbe451 100644 --- a/htdocs.net/groupe/listes-delete.php +++ b/htdocs.net/groupe/listes-delete.php @@ -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')); diff --git a/htdocs.net/groupe/listes-members.php b/htdocs.net/groupe/listes-members.php index 117aa84..d16c508 100644 --- a/htdocs.net/groupe/listes-members.php +++ b/htdocs.net/groupe/listes-members.php @@ -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')); diff --git a/htdocs.net/groupe/listes-moderate.php b/htdocs.net/groupe/listes-moderate.php index 5a2e906..44a660e 100644 --- a/htdocs.net/groupe/listes-moderate.php +++ b/htdocs.net/groupe/listes-moderate.php @@ -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')); diff --git a/htdocs.net/groupe/listes-options.php b/htdocs.net/groupe/listes-options.php index b16c004..3667754 100644 --- a/htdocs.net/groupe/listes-options.php +++ b/htdocs.net/groupe/listes-options.php @@ -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')); diff --git a/htdocs.net/groupe/listes-soptions.php b/htdocs.net/groupe/listes-soptions.php index a61d5b9..cea1523 100644 --- a/htdocs.net/groupe/listes-soptions.php +++ b/htdocs.net/groupe/listes-soptions.php @@ -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')); diff --git a/htdocs.net/groupe/listes.php b/htdocs.net/groupe/listes.php index 20715c2..7bc1aa8 100644 --- a/htdocs.net/groupe/listes.php +++ b/htdocs.net/groupe/listes.php @@ -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')); diff --git a/htdocs.net/groupe/telepaiement.php b/htdocs.net/groupe/telepaiement.php index 9410b73..5527c99 100644 --- a/htdocs.net/groupe/telepaiement.php +++ b/htdocs.net/groupe/telepaiement.php @@ -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(); diff --git a/include/xnet/page.inc.php b/include/xnet/page.inc.php index e0dbcc5..f821395 100644 --- a/include/xnet/page.inc.php +++ b/include/xnet/page.inc.php @@ -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')); } // }}} diff --git a/templates/xnet/groupe/asso.tpl b/templates/xnet/groupe/asso.tpl index 5ccc122..3c7866f 100644 --- a/templates/xnet/groupe/asso.tpl +++ b/templates/xnet/groupe/asso.tpl @@ -18,19 +18,10 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************} +

{$asso.nom} : Accueil

+ - - -
-

- {$asso.cat} - {if $asso.dom}> - {$asso.domnom} - {/if} - > {$asso.nom} : Accueil -

-
{if $asso.site} LOGO -- 2.1.4