X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fxnet.inc.php;h=9b8679cbb48a0bde4c8f0b41ecfacd63b30a9fbd;hb=1474b940a37923984e7cf5a258d9ae2192f84e81;hp=e41b5f8b56bfc94df255293e9c9d876f61388c78;hpb=0337d704b62718d7c77106c0e4c4e26fb02beacf;p=platal.git diff --git a/include/xnet.inc.php b/include/xnet.inc.php index e41b5f8..9b8679c 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_group_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); + + 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')); } // }}} @@ -59,10 +63,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')); } // }}} @@ -70,21 +81,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; -// }}} -// {{{ function new_nonhtml_page() + new_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); + check_perms(); + + $page->useMenu(); + if ($globals->asso('cat')) { + $page->assign('asso', $globals->asso()); + $page->setType($globals->asso('cat')); + } } // }}}