X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fxnet.inc.php;h=836efe4d24f8daa418cf17ef66440388b83da344;hb=2bd5b7f81f8eb5a1a04bb3741c46c2a535d090d9;hp=ce3bf439a2d715afaea252e1d2efc4a72682c48c;hpb=0df3edb9fd85fb750c47cee19a3a6b66f370cc97;p=platal.git diff --git a/include/xnet.inc.php b/include/xnet.inc.php index ce3bf43..836efe4 100644 --- a/include/xnet.inc.php +++ b/include/xnet.inc.php @@ -1,6 +1,6 @@ assign('xorg_tpl', $tpl_name); } +function new_skinned_page($tpl_name) +{ + return new_page($tpl_name); +} + // }}} + function new_identification_page() { - new_page('', AUTH_MDP); global $page; + + new_page(''); + $page->doAuth(true); $page->useMenu(); } @@ -55,10 +56,18 @@ function new_identification_page() function new_group_page($tpl_name) { - global $page,$globals; - require_once("xnet/page.inc.php"); - $page = new XnetGroupPage($tpl_name); - $page->assign('xorg_tpl', $tpl_name); + global $page, $globals; + + new_page($tpl_name); + + $page->doAuth(true); + if (!is_member() && !has_perms()) { + $page->kill("You have not sufficient credentials"); + } + + $page->useMenu(); + $page->assign('asso', $globals->asso()); + $page->setType($globals->asso('cat')); } // }}} @@ -66,10 +75,17 @@ function new_group_page($tpl_name) function new_groupadmin_page($tpl_name) { - global $page,$globals; - require_once("xnet/page.inc.php"); - $page = new XnetGroupAdmin($tpl_name); - $page->assign('xorg_tpl', $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')); } // }}} @@ -77,10 +93,17 @@ function new_groupadmin_page($tpl_name) function new_admin_page($tpl_name) { - global $page,$globals; - require_once("xnet/page.inc.php"); - $page = new XnetAdmin($tpl_name); - $page->assign('xorg_tpl', $tpl_name); + global $page, $globals; + + new_page($tpl_name); + + check_perms(); + + $page->useMenu(); + if ($globals->asso('cat')) { + $page->assign('asso', $globals->asso()); + $page->setType($globals->asso('cat')); + } } // }}} @@ -89,9 +112,17 @@ function new_admin_page($tpl_name) function new_nonhtml_page($tpl_name) { global $page, $globals; - require_once("xnet/page.inc.php"); - $page = new XnetGroupPage($tpl_name, NO_SKIN); - $page->assign('xorg_tpl', $tpl_name); + + new_page($tpl_name, NO_SKIN); + + $page->doAuth(true); + if (!is_member() && !has_perms()) { + $page->kill("You have not sufficient credentials"); + } + + $page->useMenu(); + $page->assign('asso', $globals->asso()); + $page->setType($globals->asso('cat')); } // }}}