r1508: Fixing UserAPI::post_delete() to clean up bugfieldpermission and permission...
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 18 Mar 2007 22:47:35 +0000 (22:47 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 18 Mar 2007 22:47:35 +0000 (22:47 +0000)
docs/changes.txt
includes/api_usergroup.php

index a50f06171fdc607163fb706c224d45a488d1c98b..bfac1567eac5797bb99b1687f8aed4f8c56ff546 100644 (file)
@@ -16,6 +16,7 @@
 - Fixed: The Logging system would add extra empty logs that would pollute the database; fixed this and then added queries in showhistory.php to clean it up
 - Enhancement: Users can now belong to a single primary usergroup and multiple secondary groups, greatly increasing permission flexibility
 - Enahncement: Usergroups can be cloned to allow fast duplication of permissions
+- Fixed: Even after calling UsergroupAPI::delete(), there would still be usergroup remnants in bugfieldpermission and permission tables
 
 1.2.0 Beta 1
 ===============================
index 4f2ff0c829cec1a98560e183a6038ad1cc602863..b8089856b1ec45ecf0629b063b1eae64ba182447 100644 (file)
@@ -105,8 +105,11 @@ class UsergroupAPI extends API
        */
        function post_delete()
        {
+               $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "permission WHERE usergroupid = " . $this->values['usergroupid']);
+               $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "bugfieldpermission WHERE usergroupid = " . $this->values['usergroupid']);
                $this->registry->db->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid = 2 WHERE usergroupid = " . $this->values['usergroupid']);
                build_usergroups();
+               build_permissions();
                build_assignedto();
        }
 }