X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fplatal.php;h=6a5c8b6a2e3c17b8f5890d9ecf99bb7eb8a0bbc2;hb=e1746810b6aeaba3332ff99acdbf7ff3c2e9ada6;hp=53a2def0a13646945e9e311a0a89283bef93584b;hpb=db3659bb4a5790db592359ae50c64ae340a806dd;p=platal.git diff --git a/classes/platal.php b/classes/platal.php index 53a2def..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::has_perms()) { - $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;