$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;
}
}
+ 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
{
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');
{
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');