From 866b39622fd78b677de2b54a21ec356e6ddedd33 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 18 Mar 2007 22:47:35 +0000 Subject: [PATCH] r1508: Fixing UserAPI::post_delete() to clean up bugfieldpermission and permission so that usergroups are fully deleted --- docs/changes.txt | 1 + includes/api_usergroup.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index a50f061..bfac156 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -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 =============================== diff --git a/includes/api_usergroup.php b/includes/api_usergroup.php index 4f2ff0c..b808985 100644 --- a/includes/api_usergroup.php +++ b/includes/api_usergroup.php @@ -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(); } } -- 2.43.5