Exception handling in addPerms fixed.
This commit is contained in:
parent
872bee64e3
commit
4047e33474
1 changed files with 11 additions and 8 deletions
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.11 $
|
Version : $Revision: 1.12 $
|
||||||
Location : $ $
|
Location : $ $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -33,7 +33,7 @@ require_once"gbHtml_h.php";
|
||||||
* storageServer WWW-form interface
|
* storageServer WWW-form interface
|
||||||
*
|
*
|
||||||
* @author $Author: tomas $
|
* @author $Author: tomas $
|
||||||
* @version $Revision: 1.11 $
|
* @version $Revision: 1.12 $
|
||||||
* @see Alib
|
* @see Alib
|
||||||
* @see GreenBox
|
* @see GreenBox
|
||||||
*/
|
*/
|
||||||
|
@ -378,13 +378,16 @@ switch($_REQUEST['act']){
|
||||||
*/
|
*/
|
||||||
case"addPerm";
|
case"addPerm";
|
||||||
$parid = $gb->getparent($_REQUEST['oid']);
|
$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";
|
$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;
|
break;
|
||||||
/**
|
/**
|
||||||
* removePerm
|
* removePerm
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue