PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Authentication » LiveUser » Bug #367

Parameter mismatch in LiveUser_Admin_Perm_DB_Common::removeUserAreaAdmin()

Details

Submitted2003-12-06 00:48 UTC
Fromkipaten21 at hotmail dot com
Assignedarnaud
StatusClosed
PackageLiveUser
PHP VersionIrrelevant
OSANY
Roadmaps(Not assigned)

Comments

[2003-12-06 00:48 UTC] kipaten21 at hotmail dot com

Description:
------------
The method LiveUser_Admin_Perm_DB_Common::removeUserAreaAdmin() takes two arguments, $authId and $area_id.

However, it is called from LiveUser_Admin_Perm_DB_Common::removeUser() with only the authId...

// remove user area admin relation
$result = $this->removeUserAreaAdmin($authId);

LiveUser_Admin_Perm_DB_Common::removeUserAreaAdmin() should be changed to accept an area_id optionally, that way the removeUser() method doesn't have to call removeUserAreaAdmin() for each Area that User may be an admin of.

Suggest changing prototype to....

function removeUserAreaAdmin($authId, $area_id = null)

and changing $query to....

$query = '
DELETE FROM
' . $this->prefix . 'area_admin_areas
WHERE
perm_user_id=' . $permId .'
';

if (is_numeric($area_id))
$query .= 'AND area_id=' . (int)$area_id;

[2003-12-06 00:53 UTC] kipaten21 at hotmail dot com

Also remove check for area_id at top of method...

change

if (!is_numeric($authId) && !is_numeric($area_id))

to

if (!is_numeric($authId))