2 /***************************************************************************
3 * Copyright (C) 2003-2004 Polytechnique.org *
4 * http://opensource.polytechnique.org/ *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 ***************************************************************************/
22 require_once('platal/page.inc.php');
23 require_once('xnet/smarty.plugins.inc.php');
27 class XnetPage
extends PlatalPage
29 // {{{ function XnetPage()
31 function XnetPage($tpl, $type=SKINNED
)
33 $this->PlatalPage($tpl, $type);
41 $this->_run('xnet/skin.tpl');
45 // {{{ function setType
47 function setType($type)
49 $this->assign('xnet_type', strtolower($type));
53 // {{{ function useMenu
62 $sub['accueil'] = 'index.php';
63 $sub['liste des groupes'] = 'plan.php';
66 $sub['admin X.net'] = 'admin.php';
68 $sub['déconnexion'] = 'deconnexion.php';
70 $menu["Menu Principal"] = $sub;
72 if (logged() && (is_member() ||
may_update())) {
74 $dim = $globals->asso('diminutif');
75 $sub['présentation'] = "$dim/asso.php";
76 if (may_update() ||
$globals->asso('pub') == 'public')
77 $sub['annuaire du groupe'] = "$dim/annuaire.php";
78 if ($globals->asso('mail_domain')) {
79 $sub['listes de diffusion'] = "$dim/listes.php";
81 $sub['événement'] = "$dim/evenements.php";
83 $sub['carnet'] = "$dim/carnet.php";
85 $sub['télépaiement'] = "$dim/telepaiement.php";
87 $menu[$globals->asso('nom')] = $sub;
90 if (logged() && may_update()) {
92 $sub['modifier l\'accueil'] = "$dim/edit.php";
93 if ($globals->asso('mail_domain')) {
94 $sub['envoyer un mail'] = "$dim/mail.php";
95 $sub['créer une liste'] = "$dim/listes-create.php";
96 $sub['créer un alias'] = "$dim/alias-create.php";
98 $menu['Administrer Groupe'] = $sub;
101 $this->assign('menu', $menu);
105 // {{{ function doAuth()
109 $this->register_function('list_all_my_groups', 'list_all_my_groups');
110 $this->register_modifier('cat_pp', 'cat_pp');
111 $this->assign('it_is_xnet', true
);
112 if (!logged() && Get
::has('auth')) {
113 $_SESSION['session']->doAuthX($this);
121 // {{{ class XnetAuth
123 /** Une classe pour les pages nécessitant l'authentification.
124 * (equivalent de controlauthentification.inc.php)
126 class XnetAuth
extends XnetPage
128 // {{{ function XnetAuth()
130 function XnetAuth($tpl, $type=SKINNED
)
132 $this->XnetPage($tpl, $type);
136 // {{{ function doAuth()
141 $_SESSION['session']->doAuth($this);
148 // {{{ class XnetAdmin
150 /** Une classe pour les pages réservées aux admins (authentifiés!).
152 class XnetAdmin
extends XnetAuth
154 // {{{ function XnetAdmin()
156 function XnetAdmin($tpl, $type=SKINNED
)
160 $this->XnetAuth($tpl, $type);
164 if ($globals->asso('cat')) {
165 $this->assign('asso', $globals->asso());
166 $this->setType($globals->asso('cat'));
174 // {{{ class XnetGroupPage
176 /** Une classe pour les pages réservées aux admins (authentifiés!).
178 class XnetGroupPage
extends XnetAuth
180 // {{{ function XnetAdmin()
182 function XnetGroupPage($tpl, $type=SKINNED
)
186 $this->XnetAuth($tpl, $type);
187 if (!is_member() && !has_perms()) {
188 $this->kill("You have not sufficient credentials");
192 $this->assign('asso', $globals->asso());
193 $this->setType($globals->asso('cat'));
200 // {{{ class XnetGroupAdmin
202 /** Une classe pour les pages réservées aux admins (authentifiés!).
204 class XnetGroupAdmin
extends XnetAuth
206 // {{{ function XnetAdmin()
208 function XnetGroupAdmin($tpl, $type=SKINNED
)
212 $this->XnetAuth($tpl, $type);
214 $this->kill("You have not sufficient credentials");
218 $this->assign('asso', $globals->asso());
219 $this->setType($globals->asso('cat'));
226 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: