PlatalPage($tpl, $type); } // }}} // {{{ function run() function run() { $this->_run('xnet/skin.tpl'); } // }}} // {{{ function setType function setType($type) { $this->assign('xnet_type', strtolower($type)); } // }}} // {{{ function useMenu function useMenu() { global $globals; $menu = array(); $sub = array(); $sub['accueil'] = 'index.php'; $sub['liste des groupes'] = 'plan.php'; if (logged()) { if (has_perms()) { $sub['admin X.net'] = 'admin.php'; } $sub['déconnexion'] = 'deconnexion.php'; } $menu["Menu Principal"] = $sub; if (logged() && (is_member() || may_update())) { $sub = array(); $dim = $globals->asso('diminutif'); $sub['présentation'] = "$dim/asso.php"; if (may_update() || $globals->asso('pub') == 'public') $sub['annuaire du groupe'] = "$dim/annuaire.php"; if ($globals->asso('mail_domain')) { $sub['listes de diffusion'] = "$dim/listes.php"; } $sub['événement'] = "$dim/evenements.php"; if (false) { $sub['carnet'] = "$dim/carnet.php"; } $sub['télépaiement'] = "$dim/telepaiement.php"; $menu[$globals->asso('nom')] = $sub; } if (logged() && may_update()) { $sub = array(); $sub['modifier l\'accueil'] = "$dim/edit.php"; if ($globals->asso('mail_domain')) { $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"; } $menu['Administrer Groupe'] = $sub; } $this->assign('menu', $menu); } // }}} // {{{ function doAuth() function doAuth() { $this->register_function('list_all_my_groups', 'list_all_my_groups'); $this->register_modifier('cat_pp', 'cat_pp'); $this->assign('it_is_xnet', true); if (!logged() && Get::has('auth')) { $_SESSION['session']->doAuthX($this); } } // }}} } // }}} // {{{ class XnetAuth /** Une classe pour les pages nécessitant l'authentification. * (equivalent de controlauthentification.inc.php) */ class XnetAuth extends XnetPage { // {{{ function XnetAuth() function XnetAuth($tpl, $type=SKINNED) { $this->XnetPage($tpl, $type); } // }}} // {{{ function doAuth() function doAuth() { parent::doAuth(); $_SESSION['session']->doAuth($this); } // }}} } // }}} // {{{ 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) { global $globals; $this->XnetAuth($tpl, $type); check_perms(); $this->useMenu(); if ($globals->asso('cat')) { $this->assign('asso', $globals->asso()); $this->setType($globals->asso('cat')); } } // }}} } // }}} // {{{ class XnetGroupPage /** Une classe pour les pages réservées aux admins (authentifiés!). */ class XnetGroupPage extends XnetAuth { // {{{ function XnetAdmin() function XnetGroupPage($tpl, $type=SKINNED) { global $globals; $this->XnetAuth($tpl, $type); 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 XnetGroupAdmin /** Une classe pour les pages réservées aux admins (authentifiés!). */ class XnetGroupAdmin extends XnetAuth { // {{{ function XnetAdmin() function XnetGroupAdmin($tpl, $type=SKINNED) { global $globals; $this->XnetAuth($tpl, $type); if (!may_update()) { $this->kill("You have not sufficient credentials"); } $this->useMenu(); $this->assign('asso', $globals->asso()); $this->setType($globals->asso('cat')); } // }}} } // }}} // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: ?>