Allow session informations to override the result of check_perms. In that
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 22 Dec 2008 16:46:07 +0000 (17:46 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 22 Dec 2008 16:46:07 +0000 (17:46 +0100)
case, display a message.

Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/platal.php

index a8b5459..53a2def 100644 (file)
@@ -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);