X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fxnet%2Fpage.inc.php;h=7b43294f9b3483dfaebe26ac48c7dc46fee153a7;hb=2bd5b7f81f8eb5a1a04bb3741c46c2a535d090d9;hp=261da94aeeb446b46f3f2674119f83b05803408e;hpb=bd4be95d998237aa41abcf544aaabf82b73fdce0;p=platal.git diff --git a/include/xnet/page.inc.php b/include/xnet/page.inc.php index 261da94..7b43294 100644 --- a/include/xnet/page.inc.php +++ b/include/xnet/page.inc.php @@ -109,11 +109,14 @@ class XnetPage extends PlatalPage // }}} // {{{ function doAuth() - function doAuth() + function doAuth($force = false) { $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() && $force) { + $_SESSION['session']->doLogin($this); + } if (!logged() && Get::has('auth')) { $_SESSION['session']->doAuthX($this); } @@ -123,110 +126,5 @@ class XnetPage extends PlatalPage } // }}} -// {{{ 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: ?>