From: x2003bruneau Date: Sat, 20 Jan 2007 14:13:46 +0000 (+0000) Subject: Fix admin auth X-Git-Tag: xorg/0.9.13~103 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=5777e7fc2bb449626888ed48a842c6012131061d;p=platal.git Fix admin auth git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1368 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/classes/platal.php b/classes/platal.php index d1e714f..f766817 100644 --- a/classes/platal.php +++ b/classes/platal.php @@ -182,10 +182,6 @@ class Platal $args = $this->argv; $args[0] = &$page; - if (!empty($hook['perms']) && $hook['perms'] != S::v('perms')) { - return PL_FORBIDDEN; - } - if ($hook['auth'] > S::v('auth', AUTH_PUBLIC)) { if ($hook['type'] == DO_AUTH) { global $globals; @@ -198,6 +194,10 @@ class Platal } } + if (!empty($hook['perms']) && $hook['perms'] != S::v('perms')) { + return PL_FORBIDDEN; + } + $val = call_user_func_array($hook['hook'], $args); if ($val == PL_DO_AUTH) { // The handler need a better auth with the current args diff --git a/modules/core.php b/modules/core.php index 09631e4..d0c6522 100644 --- a/modules/core.php +++ b/modules/core.php @@ -45,7 +45,7 @@ class CoreModule extends PLModule { global $globals; header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden'); - if ($_GLOBALS['IS_XNET_SITE'] && $globals->asso()) { + if (!empty($GLOBALS['IS_XNET_SITE']) && $globals->asso()) { new_skinned_page('core/403.tpl'); } else { $page->changeTpl('core/403.tpl'); @@ -56,7 +56,7 @@ class CoreModule extends PLModule { global $globals, $platal; header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); - if ($_GLOBALS['IS_XNET_SITE'] && $globals->asso()) { + if (!empty($GLOBALS['IS_XNET_SITE']) && $globals->asso()) { new_group_open_page('core/404.tpl'); } else { $page->changeTpl('core/404.tpl');