]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 319942: Preferences not deleted along with user accounts.
authorwurblzap%gmail.com <>
Wed, 14 Dec 2005 04:20:43 +0000 (04:20 +0000)
committerwurblzap%gmail.com <>
Wed, 14 Dec 2005 04:20:43 +0000 (04:20 +0000)
Patch by Marc Schumann <wurblzap@gmail.com>,
r=LpSolit, a=justdave

editusers.cgi
template/en/default/admin/users/confirm-delete.html.tmpl

index cc83fdb083ce86f99c73c7eeac114f750cc556fc..5d74374b60e5e0bada5c4c9d77faa8ba7d8288ee 100755 (executable)
@@ -423,6 +423,9 @@ if ($action eq 'search') {
     $vars->{'bugs_activity'} = $dbh->selectrow_array(
         'SELECT COUNT(*) FROM bugs_activity WHERE who = ?',
         undef, $otherUserID);
+    $vars->{'email_setting'} = $dbh->selectrow_array(
+        'SELECT COUNT(*) FROM email_setting WHERE user_id = ?',
+        undef, $otherUserID);
     $vars->{'flags'}{'requestee'} = $dbh->selectrow_array(
         'SELECT COUNT(*) FROM flags WHERE requestee_id = ? AND is_active = 1',
         undef, $otherUserID);
@@ -435,6 +438,9 @@ if ($action eq 'search') {
     $vars->{'namedqueries'} = $dbh->selectrow_array(
         'SELECT COUNT(*) FROM namedqueries WHERE userid = ?',
         undef, $otherUserID);
+    $vars->{'profile_setting'} = $dbh->selectrow_array(
+        'SELECT COUNT(*) FROM profile_setting WHERE user_id = ?',
+        undef, $otherUserID);
     $vars->{'profiles_activity'} = $dbh->selectrow_array(
         'SELECT COUNT(*) FROM profiles_activity WHERE who = ? AND userid != ?',
         undef, ($otherUserID, $otherUserID));
@@ -486,6 +492,8 @@ if ($action eq 'search') {
                          'logincookies WRITE',
                          'profiles WRITE',
                          'profiles_activity WRITE',
+                         'email_setting WRITE',
+                         'profile_setting WRITE',
                          'groups READ',
                          'bug_group_map READ',
                          'user_group_map WRITE',
@@ -555,8 +563,12 @@ if ($action eq 'search') {
     }
 
     # Simple deletions in referred tables.
+    $dbh->do('DELETE FROM email_setting WHERE user_id = ?', undef,
+             $otherUserID);
     $dbh->do('DELETE FROM logincookies WHERE userid = ?', undef, $otherUserID);
     $dbh->do('DELETE FROM namedqueries WHERE userid = ?', undef, $otherUserID);
+    $dbh->do('DELETE FROM profile_setting WHERE user_id = ?', undef,
+             $otherUserID);
     $dbh->do('DELETE FROM profiles_activity WHERE userid = ? OR who = ?', undef,
              ($otherUserID, $otherUserID));
     $dbh->do('DELETE FROM tokens WHERE userid = ?', undef, $otherUserID);
index afe464697ac5a59f556c7224343f67617e26d0dc..71e2068adadd57c9c8a7c1e3ec5a5b56129396d3 100644 (file)
     [% display_warning = 1 %]
   [% END %]
 
-  [% IF assignee_or_qa || cc || flags.requestee || namedqueries ||
-        series || votes || watch.watched || watch.watcher ||
-        whine_events || whine_schedules %]
+  [% IF assignee_or_qa || cc || email_setting || flags.requestee ||
+        namedqueries || profile_setting || series || votes || watch.watched ||
+        watch.watcher || whine_events || whine_schedules %]
     <div class="warningmessages">
       <p>The following deletions are <b>safe</b> and will not generate
       referential integrity inconsistencies.</p>
             If you delete the user account, it will be removed from these CC lists.
           </li>
         [% END %]
+        [% IF email_setting %]
+          <li>
+            The user's e-mail settings will be deleted along with the user
+            account.
+          </li>
+        [% END %]
         [% IF flags.requestee %]
           <li>
             [% otheruser.login FILTER html %] has been
             will be deleted along with the user account.
           </li>
         [% END %]
+        [% IF profile_setting %]
+          <li>
+            The user's preference settings will be deleted along with the user
+            account.
+          </li>
+        [% END %]
         [% IF series %]
           <li>
             [% otheruser.login FILTER html %] has created