PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Authentication » LiveUser » Bug #385

Suggestion for new methods

Details

Submitted2003-12-09 00:30 UTC
Fromkipaten21 at hotmail dot com
Assignedlsmith
StatusClosed
PackageLiveUser
PHP VersionIrrelevant
OSANY
Roadmaps(Not assigned)

Comments

[2003-12-09 00:30 UTC] kipaten21 at hotmail dot com

Description:
------------
Suggest adding the following methods...

LiveUser_Admin_Perm_Container_DB_Complex::getParentGroup()

Returns the parent group_id that $group_id is a child of.

LiveUser_Admin_Perm_Container_DB_Complex::getUserGroups()

Returns an array of group_id's that the user is a member of.

/**
* get parent group of group
*
* @access public
* @param integer id of group
* @return mixed integer or DB Error object
*/
function getParentGroup($group_id)
{
$query = 'SELECT
group_id
FROM
' . $this->prefix . 'group_subgroups
WHERE
subgroup_id = ' . (int)$group_id;

$group_id = $this->dbc->getAll($query, null, DB_FETCHMODE_ASSOC);

return $group_id;
}

/**
* get groups a user belongs to
*
* @access public
* @param integer id of user
* @return mixed array or DB Error object
*/
function getUserGroups($authId)
{
$query = 'SELECT
group_id
FROM
' . $this->prefix . 'groupusers
WHERE
perm_user_id = ' . (int)$this->_getPermUserId($authId);

$groups = $this->dbc->getAll($query, null, DB_FETCHMODE_ASSOC);

return $groups;
}

[2003-12-09 00:34 UTC] kipaten21 at hotmail dot com

getUserGroups() should also be added to LiveUser_Admin_Perm_Container_DB_Medium and LiveUser_Admin_Perm_Container_MDB_Complex

getParentGroup() should also be added to LiveUser_Admin_Perm_Container_MDB_Complex