Skip to content
Browse files

- properties are now lower bumby camel

git-svn-id: http://svn.php.net/repository/pear/packages/LiveUser/trunk@191706 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 066df1e commit 33b90366e97c59c1ce1c49a3b0d86b8d0bf066ac Lukas Smith committed Jul 28, 2005
Showing with 59 additions and 59 deletions.
  1. +29 −29 Perm/Complex.php
  2. +30 −30 Perm/Medium.php
View
58 Perm/Complex.php
@@ -119,56 +119,56 @@ function _readImpliedRights($rightIds, $table)
* an array of this format:
* RightName -> Value
*
- * @param int $permUserId
+ * @param int $perm_user_id
* @see readRights()
* @return void
*
* @access private
*/
- function readUserRights($permUserId)
+ function readUserRights($perm_user_id)
{
- $userRights = parent::readUserRights($permUserId);
- $this->userRights = $this->_readImpliedRights($userRights, 'user');
+ $user_rights = parent::readUserRights($perm_user_id);
+ $this->user_rights = $this->_readImpliedRights($user_rights, 'user');
- return $this->userRights;
+ return $this->user_rights;
} // end func readUserRights
/**
* Reads all the group ids in that the user is also a member of
* (all groups that are subgroups of these are also added recursively)
*
- * @param int $permUserId
+ * @param int $perm_user_id
* @see readRights()
* @return void
*
* @access private
*/
- function readGroups($permUserId)
+ function readGroups($perm_user_id)
{
- $result = parent::readGroups($permUserId);
+ $result = parent::readGroups($perm_user_id);
// get all subgroups recursively
while (count($result)) {
- $result = $this->readSubGroups($this->groupIds, $result);
+ $result = $this->readSubGroups($this->group_ids, $result);
if (is_array($result)) {
- $this->groupIds = array_merge($result, $this->groupIds);
+ $this->group_ids = array_merge($result, $this->group_ids);
}
}
- return $this->groupIds;
+ return $this->group_ids;
} // end func readGroups
/**
*
*
- * @param array $groupIds
+ * @param array $group_ids
* @param array $newGroupIds
* @return mixed array or false on failure
*
* @access public
*/
- function readSubGroups($groupIds, $newGroupIds)
+ function readSubGroups($group_ids, $newGroupIds)
{
- $result = $this->_storage->readSubGroups($groupIds, $newGroupIds);
+ $result = $this->_storage->readSubGroups($group_ids, $newGroupIds);
if ($result === false) {
return false;
}
@@ -180,30 +180,30 @@ function readSubGroups($groupIds, $newGroupIds)
* a two-dimensional array of this format:
* "GroupName" => "RightName" -> "Level"
*
- * @param array $groupIds array with id's for the groups
+ * @param array $group_ids array with id's for the groups
* that rights will be read from
* @see readRights()
* @return void
*
* @access private
*/
- function readGroupRights($groupIds)
+ function readGroupRights($group_ids)
{
- $groupRights = parent::readGroupRights($groupIds);
- $this->groupRights = $this->_readImpliedRights($groupRights, 'group');
+ $group_rights = parent::readGroupRights($group_ids);
+ $this->group_rights = $this->_readImpliedRights($group_rights, 'group');
- return $this->groupRights;
+ return $this->group_rights;
} // end func readGroupRights
/**
* Checks if the current user has a certain right in a
* given area at the necessary level.
*
- * Level 1: requires that owner_user_id matches $this->permUserId
+ * Level 1: requires that owner_user_id matches $this->perm_user_id
* Level 2: requires that the $owner_group_id matches the id one of
- * the (sub)groups that $this->permUserId is a memember of
+ * the (sub)groups that $this->perm_user_id is a memember of
* or requires that the $owner_user_id matches a perm_user_id of
- * a memeber of one of $this->permUserId's (sub)groups
+ * a memeber of one of $this->perm_user_id's (sub)groups
* Level 3: no requirements
*
* Important note:
@@ -234,8 +234,8 @@ function checkLevel($level, $owner_user_id, $owner_group_id)
return $level;
}
// level 1 or higher
- if ((!is_array($owner_user_id) && $this->permUserId == $owner_user_id) ||
- is_array($owner_user_id) && in_array($this->permUserId, $owner_user_id))
+ if ((!is_array($owner_user_id) && $this->perm_user_id == $owner_user_id) ||
+ is_array($owner_user_id) && in_array($this->perm_user_id, $owner_user_id))
{
return $level;
// level 2 or higher
@@ -244,10 +244,10 @@ function checkLevel($level, $owner_user_id, $owner_group_id)
// check if the ressource is owned by a (sub)group
// that the user is part of
if (is_array($owner_group_id)) {
- if (count(array_intersect($owner_group_id, $this->groupIds))) {
+ if (count(array_intersect($owner_group_id, $this->group_ids))) {
return $level;
}
- } elseif (in_array($owner_group_id, $this->groupIds)) {
+ } elseif (in_array($owner_group_id, $this->group_ids)) {
return $level;
}
}
@@ -257,14 +257,14 @@ function checkLevel($level, $owner_user_id, $owner_group_id)
/**
*
*
- * @param int $permUserId
+ * @param int $perm_user_id
* @return mixed array or false on failure
*
* @access public
*/
- function readAreaAdminAreas($permUserId)
+ function readAreaAdminAreas($perm_user_id)
{
- $result = $this->_storage->readAreaAdminAreas($permUserId);
+ $result = $this->_storage->readAreaAdminAreas($perm_user_id);
if ($result === false) {
return false;
}
View
60 Perm/Medium.php
@@ -80,7 +80,7 @@ class LiveUser_Perm_Medium extends LiveUser_Perm_Simple
* @var array
* @access public
*/
- var $groupIds = array();
+ var $group_ids = array();
/**
* One-dimensional array containing only the group
@@ -91,7 +91,7 @@ class LiveUser_Perm_Medium extends LiveUser_Perm_Simple
* @var array
* @access public
*/
- var $groupRights = array();
+ var $group_rights = array();
/**
* Reads all rights of current user into an
@@ -107,42 +107,42 @@ function readRights()
{
$this->rights = array();
- $result = $this->readUserRights($this->permUserId);
+ $result = $this->readUserRights($this->perm_user_id);
if ($result === false) {
return false;
}
- if ($this->userType == LIVEUSER_AREAADMIN_TYPE_ID) {
- $result = $this->readAreaAdminAreas($this->permUserId);
+ if ($this->perm_type == LIVEUSER_AREAADMIN_TYPE_ID) {
+ $result = $this->readAreaAdminAreas($this->perm_user_id);
if ($result === false) {
return false;
}
if (is_array($this->areaAdminAreas)) {
- if (is_array($this->userRights)) {
- $this->userRights = $this->areaAdminAreas + $this->userRights;
+ if (is_array($this->user_rights)) {
+ $this->user_rights = $this->areaAdminAreas + $this->user_rights;
} else {
- $this->userRights = $this->areaAdminAreas;
+ $this->user_rights = $this->areaAdminAreas;
}
}
}
- $result = $this->readGroups($this->permUserId);
+ $result = $this->readGroups($this->perm_user_id);
if ($result === false) {
return false;
}
- $result = $this->readGroupRights($this->groupIds);
+ $result = $this->readGroupRights($this->group_ids);
if ($result === false) {
return false;
}
- $tmpRights = $this->groupRights;
+ $tmpRights = $this->group_rights;
// Check if user has individual rights...
- if (is_array($this->userRights)) {
+ if (is_array($this->user_rights)) {
// Overwrite values from temporary array with values from userrights
- foreach ($this->userRights as $right => $level) {
+ foreach ($this->user_rights as $right => $level) {
if (isset($tmpRights[$right])) {
if ($level < 0) {
// Revoking rights: A negative value indicates that the
@@ -173,47 +173,47 @@ function readRights()
/**
*
*
- * @param int $permUserId
+ * @param int $perm_user_id
* @return mixed array or false on failure
*
* @access public
*/
- function readGroups($permUserId)
+ function readGroups($perm_user_id)
{
- $this->groupIds = array();
+ $this->group_ids = array();
- $result = $this->_storage->readGroups($permUserId);
+ $result = $this->_storage->readGroups($perm_user_id);
if ($result === false) {
return false;
}
- $this->groupIds = $result;
- return $this->groupIds;
+ $this->group_ids = $result;
+ return $this->group_ids;
}
/**
*
*
- * @param array $groupIds
+ * @param array $group_ids
* @return mixed array or false on failure
*
* @access public
*/
- function readGroupRights($groupIds)
+ function readGroupRights($group_ids)
{
- $this->groupRights = array();
+ $this->group_rights = array();
- if (!is_array($groupIds) || !count($groupIds)) {
+ if (!is_array($group_ids) || !count($group_ids)) {
return null;
}
- $result = $this->_storage->readGroupRights($groupIds);
+ $result = $this->_storage->readGroupRights($group_ids);
if ($result === false) {
return false;
}
- $this->groupRights = $result;
- return $this->groupRights;
+ $this->group_rights = $result;
+ return $this->group_rights;
}
/**
@@ -223,15 +223,15 @@ function readGroupRights($groupIds)
*
* @param integer $group_id Id of the group to check for.
* @param boolean $ondemand allow ondemand reading of groups
- * @return boolean. If groupIds isn't populated then false,
- if the group_id exists in groupIds then true else false.
+ * @return boolean. If group_ids isn't populated then false,
+ if the group_id exists in group_ids then true else false.
*
* @access public
*/
function checkGroup($group_id)
{
- if (is_array($this->groupIds)) {
- return in_array($group_id, $this->groupIds);
+ if (is_array($this->group_ids)) {
+ return in_array($group_id, $this->group_ids);
}
return false;
} // end func checkGroup

0 comments on commit 33b9036

Please sign in to comment.
Something went wrong with that request. Please try again.