aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-11-19 18:43:08 +0000
committerlpsolit%gmail.com <>2007-11-19 18:43:08 +0000
commit1040bda8cc6c2017ecda26bdcbb95f1d64398d1e (patch)
tree18605960c5e4af8d4598065867b4e0701e7087bc /editusers.cgi
parentBug 403834: Replace table locks with database transactions in tokens, votes, ... (diff)
downloadbugzilla-1040bda8cc6c2017ecda26bdcbb95f1d64398d1e.tar.gz
bugzilla-1040bda8cc6c2017ecda26bdcbb95f1d64398d1e.tar.bz2
bugzilla-1040bda8cc6c2017ecda26bdcbb95f1d64398d1e.zip
Bug 395924: Deleting a user account may delete other user's whine - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wurblzap a=LpSolit
Diffstat (limited to 'editusers.cgi')
-rwxr-xr-xeditusers.cgi11
1 files changed, 2 insertions, 9 deletions
diff --git a/editusers.cgi b/editusers.cgi
index b996c139e..6dda0e97a 100755
--- a/editusers.cgi
+++ b/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()) {