Fix admin auth
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 20 Jan 2007 14:13:46 +0000 (14:13 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 20 Jan 2007 14:13:46 +0000 (14:13 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1368 839d8a87-29fc-0310-9880-83ba4fa771e5

classes/platal.php
modules/core.php

index d1e714f..f766817 100644 (file)
@@ -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
index 09631e4..d0c6522 100644 (file)
@@ -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');