Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
}
}
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;
}
}
$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;