From 65a62024b8533c90b82c2320fcb73b410a3b0969 Mon Sep 17 00:00:00 2001 From: nbm Date: Thu, 29 Sep 2005 22:51:59 +0000 Subject: [PATCH] Make sure the userID in the session gives us a valid user, and specify the basic errorPage function. --- lib/dispatcher.inc.php | 10 ++++++++++ 1 file changed, 10 insertions(+), 0 deletions(-) diff --git a/lib/dispatcher.inc.php b/lib/dispatcher.inc.php index 63d2cc1..7287571 100644 --- a/lib/dispatcher.inc.php +++ b/lib/dispatcher.inc.php @@ -75,6 +75,11 @@ class KTStandardDispatcher extends KTDispatcher { $this->permissionDenied(); exit(0); } + $this->oUser =& User::get($_SESSION['userID']); + if (PEAR::isError($this->oUser) || ($this->oUser === false)) { + $this->permissionDenied(); + exit(0); + } } if ($bAdminRequired !== false) { @@ -102,6 +107,11 @@ class KTStandardDispatcher extends KTDispatcher { $main->setCentralPayload($data); $main->render(); } + + function errorPage($errorMessage) { + $this->handleOutput($errorMessage); + exit(0); + } } class KTAdminDispatcher extends KTStandardDispatcher { -- libgit2 0.21.4