From 4047e334746710270e2bb79a7a26e117f2ce71a5 Mon Sep 17 00:00:00 2001 From: tomas Date: Thu, 13 Jan 2005 15:34:08 +0000 Subject: [PATCH] Exception handling in addPerms fixed. --- .../modules/storageServer/var/html/gbHttp.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/livesupport/modules/storageServer/var/html/gbHttp.php b/livesupport/modules/storageServer/var/html/gbHttp.php index c71487fed..ba6209786 100644 --- a/livesupport/modules/storageServer/var/html/gbHttp.php +++ b/livesupport/modules/storageServer/var/html/gbHttp.php @@ -23,7 +23,7 @@ Author : $Author: tomas $ - Version : $Revision: 1.11 $ + Version : $Revision: 1.12 $ Location : $ $ ------------------------------------------------------------------------------*/ @@ -33,7 +33,7 @@ require_once"gbHtml_h.php"; * storageServer WWW-form interface * * @author $Author: tomas $ - * @version $Revision: 1.11 $ + * @version $Revision: 1.12 $ * @see Alib * @see GreenBox */ @@ -378,13 +378,16 @@ switch($_REQUEST['act']){ */ case"addPerm"; $parid = $gb->getparent($_REQUEST['oid']); - if($gb->checkPerm($userid, 'editPerms', $parid)){ - $gb->addPerm($_REQUEST['subj'], $_REQUEST['permAction'], - $_REQUEST['id'], $_REQUEST['allowDeny']); - }else{ - $_SESSION['alertMsg']='Access denied.'; - } $redirUrl="gbHtmlPerms.php?id=$id"; + if(!$gb->checkPerm($userid, 'editPerms', $parid)){ + $_SESSION['alertMsg']='Access denied.'; + break; + } + $res = $gb->addPerm($_REQUEST['subj'], $_REQUEST['permAction'], + $_REQUEST['id'], $_REQUEST['allowDeny']); + if(PEAR::isError($res)){ + $_SESSION['alertMsg'] = $res->getMessage()." (".$res->getCode().")"; + } break; /** * removePerm