From: Florent Bruneau Date: Mon, 22 Dec 2008 16:46:07 +0000 (+0100) Subject: Allow session informations to override the result of check_perms. In that X-Git-Tag: core/1.0.1~49 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=db3659bb4a5790db592359ae50c64ae340a806dd;p=platal.git Allow session informations to override the result of check_perms. In that case, display a message. Signed-off-by: Florent Bruneau --- diff --git a/classes/platal.php b/classes/platal.php index a8b5459..53a2def 100644 --- a/classes/platal.php +++ b/classes/platal.php @@ -267,7 +267,11 @@ abstract class Platal } } if ($hook['auth'] != AUTH_PUBLIC && !$this->check_perms($hook['perms'])) { - return PL_FORBIDDEN; + if (S::has_perms()) { + $page->trigWarning('Tu accèdes à cette page car tu es administrateur du site.'); + } else { + return PL_FORBIDDEN; + } } $val = call_user_func_array($hook['hook'], $args);