Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.16.14

Bug #367 Parameter mismatch in LiveUser_Admin_Perm_DB_Common::removeUserAreaAdmin()
Submitted: 2003-12-06 00:48 UTC
From: kipaten21 at hotmail dot com Assigned: arnaud
Status: Closed Package: LiveUser
PHP Version: Irrelevant OS: ANY
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 2 + 11 = ?

 
 [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;

Comments

 [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))
 [2003-12-07 15:34 UTC] arnaud
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better. Makes sense to have that behaviour.