From 83fd77be71811a1d371bad8e60b3c5b053c0292a Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Mon, 23 Feb 2004 17:24:58 +0000 Subject: [PATCH] =?utf8?q?gestion=20des=20droits=20erron=E9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- include/xorg.page.inc.php | 6 ++++++ include/xorg.session.inc.php | 7 ++----- templates/failure.tpl | 7 +++++++ 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 templates/failure.tpl diff --git a/include/xorg.page.inc.php b/include/xorg.page.inc.php index d740e6b..ec9b4f8 100644 --- a/include/xorg.page.inc.php +++ b/include/xorg.page.inc.php @@ -80,6 +80,12 @@ class XorgPage extends DiogenesCorePage { exit; } + function failure() { + $this->_tpl = 'failure.tpl'; + $this->_page_type = SKINNED; + $this->run(); + } + function xorg_is_cached($append_to_id="") { if($this->_page_type == NO_SKIN) return parent::is_cached($this->_tpl); diff --git a/include/xorg.session.inc.php b/include/xorg.session.inc.php index 62f2f01..95ac896 100644 --- a/include/xorg.session.inc.php +++ b/include/xorg.session.inc.php @@ -103,13 +103,10 @@ class XorgSession extends DiogenesCoreSession { * TODO RECODER */ function check_perms($auth_array=array()) { + global $page; if (!has_perms($auth_array)) { $_SESSION['log']->log("noperms",$_SERVER['PHP_SELF']); - echo "
"; - echo "Tu n'as pas les permissions nécessaires pour accéder à cette page."; - echo "
"; - include("footer.inc.php"); - exit; + $page->failure(); } } diff --git a/templates/failure.tpl b/templates/failure.tpl new file mode 100644 index 0000000..111dde1 --- /dev/null +++ b/templates/failure.tpl @@ -0,0 +1,7 @@ +{* $Id: failure.tpl,v 1.1 2004-02-23 17:24:59 x2000habouzit Exp $ *} + +
+Tu n'as pas les permissions nécessaires pour accéder à cette page. +
+ +{* vim:set et sw=2 sts=2 sws=2: *} -- 2.1.4