From 3a77d792fb194baedbd89a3dda52f75221a7490a Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" Date: Mon, 19 Nov 2007 12:45:32 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20395924:=20Deleting=20a=20user=20account?= =?UTF-8?q?=20may=20delete=20other=20user's=20whine=20-=20Patch=20by=20Fr?= =?UTF-8?q?=C3=83=C2=A9d=C3=83=C2=A9ric=20Buclin=20=20r?= =?UTF-8?q?=3Dwurblzap=20a=3DLpSolit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.0.0.236/trunk@239645 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/editusers.cgi | 11 +----- .../admin/users/confirm-delete.html.tmpl | 38 +++++++++---------- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/mozilla/webtools/bugzilla/editusers.cgi b/mozilla/webtools/bugzilla/editusers.cgi index b996c139e8d..6dda0e97aa0 100755 --- a/mozilla/webtools/bugzilla/editusers.cgi +++ b/mozilla/webtools/bugzilla/editusers.cgi @@ -551,9 +551,6 @@ if ($action eq 'search') { } # 2) Whines - my $sth_whineidFromSchedules = $dbh->prepare( - qq{SELECT eventid FROM whine_schedules - WHERE mailto = ? AND mailto_type = ?}); my $sth_whineidFromEvents = $dbh->prepare( 'SELECT id FROM whine_events WHERE owner_userid = ?'); my $sth_deleteWhineEvent = $dbh->prepare( @@ -563,12 +560,8 @@ if ($action eq 'search') { my $sth_deleteWhineSchedule = $dbh->prepare( 'DELETE FROM whine_schedules WHERE eventid = ?'); - $sth_whineidFromSchedules->execute($otherUserID, MAILTO_USER); - while ($id = $sth_whineidFromSchedules->fetchrow_array()) { - $sth_deleteWhineQuery->execute($id); - $sth_deleteWhineSchedule->execute($id); - $sth_deleteWhineEvent->execute($id); - } + $dbh->do('DELETE FROM whine_schedules WHERE mailto = ? AND mailto_type = ?', + undef, ($otherUserID, MAILTO_USER)); $sth_whineidFromEvents->execute($otherUserID); while ($id = $sth_whineidFromEvents->fetchrow_array()) { diff --git a/mozilla/webtools/bugzilla/template/en/default/admin/users/confirm-delete.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/admin/users/confirm-delete.html.tmpl index 52c98f0b1be..218775dca69 100644 --- a/mozilla/webtools/bugzilla/template/en/default/admin/users/confirm-delete.html.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/admin/users/confirm-delete.html.tmpl @@ -372,27 +372,15 @@ will cease along with the deletion of the user account. [% END %] - [% IF whine_events || whine_schedules %] + [% IF whine_events %]
  • - [% otheruser.login FILTER html %] - [% IF whine_events %] - has scheduled - [% IF whine_events == 1 %] - a whine - [% ELSE %] - [%+ whine_events %] whines - [% END %] - [% END %] - [% IF whine_schedules %] - [%+ 'and' IF whine_events %] - is on the receiving end of - [% IF whine_schedules == 1 %] - a whine - [% ELSE %] - [%+ whine_schedules %] whines - [% END %] + [% otheruser.login FILTER html %] has scheduled + [% IF whine_events == 1 %] + a whine + [% ELSE %] + [%+ whine_events %] whines [% END %]. - [% IF whine_events + whine_schedules == 1 %] + [% IF whine_events == 1 %] This whine [% ELSE %] These whines @@ -400,6 +388,18 @@ will be deleted along with the user account.
  • [% END %] + [% IF whine_schedules %] +
  • + [% otheruser.login FILTER html %] is on the receiving end of + [% IF whine_schedules == 1 %] + a whine + [% ELSE %] + [%+ whine_schedules %] whines + [% END %]. + The corresponding schedules will be deleted along with the user account, + but the whines themselves will be left unaltered. +
  • + [% END %] [% display_warning = 1 %]