From 5ecbc66d7efe3e621d8e1a1c241f847b849fa19f Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Wed, 24 Nov 2010 09:03:20 +0000 Subject: [PATCH] Fixed regressions in the user portal SVN:trunk[968] --- portal/index.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/portal/index.php b/portal/index.php index b093665232..31f10776c1 100644 --- a/portal/index.php +++ b/portal/index.php @@ -22,6 +22,7 @@ * @author Denis Flaven * @license http://www.opensource.org/licenses/gpl-3.0.html LGPL */ +require_once('../approot.inc.php'); require_once(APPROOT.'/application/application.inc.php'); require_once(APPROOT.'/application/nicewebpage.class.inc.php'); require_once(APPROOT.'/application/wizardhelper.class.inc.php'); @@ -715,7 +716,7 @@ function RequestDetails(WebPage $oP, $id) * @param WebPage $oP The current page, for errors output * @return Organization The user's org or null in case of problem... */ -function GetUserOrg($oP) +function GetUserOrg() { $oOrg = null; $iContactId = UserRights::GetContactId(); @@ -726,7 +727,7 @@ function GetUserOrg($oP) } else { - $oP->add("

".Dict::S('Portal:ErrorNoContactForThisUser')."

"); + throw new Exception(Dict::S('Portal:ErrorNoContactForThisUser')); } return $oOrg; } @@ -741,7 +742,7 @@ try require_once(APPROOT.'/application/loginwebpage.class.inc.php'); LoginWebPage::DoLogin(false /* bMustBeAdmin */, true /* IsAllowedToPortalUsers */); // Check user rights and prompt if needed - $oUserOrg = GetUserOrg($oP); + $oUserOrg = GetUserOrg(); $sCode = $oUserOrg->Get('code'); $sAlternateStylesheet = ''; @@ -842,4 +843,4 @@ catch(Exception $e) IssueLog::Error($e->getMessage()); } } -?> \ No newline at end of file +?>