X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fplatal.php;h=6a5c8b6a2e3c17b8f5890d9ecf99bb7eb8a0bbc2;hb=6f58e0613a47d9eeb5004c992e6c59b7cf9ec0ea;hp=27cdd096f5a9912877d9e4c605dfec9b244cd67f;hpb=f1c8bb75eaae934ac2dd1cbd7f8bbc10960413ee;p=platal.git diff --git a/classes/platal.php b/classes/platal.php index 27cdd09..6a5c8b6 100644 --- a/classes/platal.php +++ b/classes/platal.php @@ -1,6 +1,6 @@ startAvailableAuth()) { - Platal::page()->trigError('Données d\'authentification invalide.'); + Platal::page()->trigError("Données d'authentification invalides."); } $modules = func_get_args(); @@ -62,7 +62,7 @@ abstract class Platal foreach ($modules as $module) { $module = strtolower($module); $this->__mods[$module] = $m = PLModule::factory($module); - $this->__hooks += $m->handlers(); + $this->__hooks = $m->handlers() + $this->__hooks; } if ($globals->mode == '') { @@ -267,9 +267,7 @@ abstract class Platal } } if ($hook['auth'] != AUTH_PUBLIC && !$this->check_perms($hook['perms'])) { - if (S::admin()) { - $page->trigWarning('Tu accèdes à cette page car tu es administrateur du site.'); - } else { + if (self::notAllowed()) { return PL_FORBIDDEN; } } @@ -330,6 +328,16 @@ abstract class Platal $page->run(); } + public static function notAllowed() + { + if (S::admin()) { + self::page()->trigWarning('Tu accèdes à cette page car tu es administrateur du site.'); + return false; + } else { + return true; + } + } + public static function load($modname, $include = null) { global $platal;