From 26f8edd60b653da2c94ee18b60067368c35102bb Mon Sep 17 00:00:00 2001 From: nuxsmin Date: Wed, 30 Oct 2013 12:31:36 +0100 Subject: [PATCH] Error on retrieving account permissions While retieving account details it shows a permission denied error. --- inc/account.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/inc/account.class.php b/inc/account.class.php index 3efdc8ba..74f1b2d3 100644 --- a/inc/account.class.php +++ b/inc/account.class.php @@ -672,7 +672,11 @@ class SP_Account { if ( ! is_array($this->accountCacheUserGroupsId) ){ $this->accountCacheUserGroupsId = array($accId => array()); - } + } else{ + if ( array_key_exists($accId, $this->accountCacheUserGroupsId) ){ + return $this->accountCacheUserGroupsId[$accId]; + } + } $query = "SELECT accgroup_groupId FROM accGroups " . "WHERE accgroup_accountId = ".(int)$accId; @@ -786,9 +790,9 @@ class SP_Account { // Convertimos en array la lista de grupos de la cuenta if ( $this->accountId && $accountId == "" ){ - $arrAccUGroups = ( is_array($this->accountCacheUserGroupsId) && array_key_exists($this->accountId, $this->accountCacheUserGroupsId) ) ? $this->accountUserGroupsId[$this->accountId] : $this->getGroupsAccount($this->accountId); + $arrAccUGroups = $this->getGroupsAccount(); } elseif ( $accountId ) { - $arrAccUGroups = ( is_array($this->accountCacheUserGroupsId) && array_key_exists($accountId, $this->accountCacheUserGroupsId) ) ? $this->accountCacheUserGroupsId[$accountId] : $this->getGroupsAccount($accountId); + $arrAccUGroups = $this->getGroupsAccount($accountId); } else { return FALSE; }