X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fxnet.inc.php;h=34ea7dd0add9ec7f76d465c6c7876ecaff1400f6;hb=4e2929c6e6e7e5e175719a007a79598952bd9023;hp=aea2c122f1f5bd90a0de29411cd250ae2fc719cf;hpb=cab0809050d58f8484608e91f7555ebd69dcb451;p=platal.git diff --git a/include/xnet.inc.php b/include/xnet.inc.php index aea2c12..34ea7dd 100644 --- a/include/xnet.inc.php +++ b/include/xnet.inc.php @@ -20,10 +20,9 @@ ***************************************************************************/ require_once('platal.inc.php'); -require_once('xnet/globals.inc.php'); +require_once('globals.inc.php'); require_once('xnet/session.inc.php'); -XnetGlobals::init(); -XnetGlobals::setlocale(); +$globals = new PlatalGlobals('XnetSession'); XnetSession::init(); // {{{ function new_skinned_page() @@ -42,32 +41,29 @@ function new_skinned_page($tpl_name) } // }}} +// {{{ function new_group_open_page() -function new_identification_page() +function new_group_open_page($tpl_name, $refuse_access = false) { - global $page; + global $page, $globals; + + new_page($tpl_name); - new_page(''); - $page->doAuth(true); $page->useMenu(); + $page->assign('asso', $globals->asso()); + $page->setType($globals->asso('cat')); + + if ($refuse_access) { + $page->kill("Vous n'avez pas les droits suffisants pour accéder à cette page"); + } } +// }}} // {{{ function new_group_page() function new_group_page($tpl_name) { - global $page, $globals; - - new_page($tpl_name); - - $page->doAuth(true); - if (!is_member() && !S::has_perms()) { - $page->kill("You have not sufficient credentials"); - } - - $page->useMenu(); - $page->assign('asso', $globals->asso()); - $page->setType($globals->asso('cat')); + new_group_open_page($tpl_name, !is_member() && !S::has_perms()); } // }}} @@ -75,17 +71,7 @@ function new_group_page($tpl_name) function new_groupadmin_page($tpl_name) { - global $page, $globals; - - new_page($tpl_name); - - if (!may_update()) { - $page->kill("You have not sufficient credentials"); - } - - $page->useMenu(); - $page->assign('asso', $globals->asso()); - $page->setType($globals->asso('cat')); + new_group_open_page($tpl_name, !may_update()); } // }}} @@ -107,24 +93,5 @@ function new_admin_page($tpl_name) } // }}} -// {{{ function new_nonhtml_page() - -function new_nonhtml_page($tpl_name) -{ - global $page, $globals; - - new_page($tpl_name, NO_SKIN); - - $page->doAuth(true); - if (!is_member() && !S::has_perms()) { - $page->kill("You have not sufficient credentials"); - } - - $page->useMenu(); - $page->assign('asso', $globals->asso()); - $page->setType($globals->asso('cat')); -} - -// }}} // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: ?>