diff options
author | lpsolit%gmail.com <> | 2007-10-10 06:21:48 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2007-10-10 06:21:48 +0200 |
commit | 24a90239690d3c59538cb4044bc31411efd83464 (patch) | |
tree | 09242819613a0cd56319b09bf258077dce147d70 /editgroups.cgi | |
parent | a81a0804496d263f9de71b03e2ebf612e3c534cc (diff) | |
download | bugzilla-24a90239690d3c59538cb4044bc31411efd83464.tar.gz bugzilla-24a90239690d3c59538cb4044bc31411efd83464.tar.xz |
Bug 398976: edit*.cgi scripts should use transactions for database interaction - Patch by Emmanuel Seyman <eseyman@linagora.com> r/a=mkanat
Diffstat (limited to 'editgroups.cgi')
-rwxr-xr-x | editgroups.cgi | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/editgroups.cgi b/editgroups.cgi index 43875da51..19db870ec 100755 --- a/editgroups.cgi +++ b/editgroups.cgi @@ -502,8 +502,7 @@ if ($action eq 'remove_regexp') { my $group = new Bugzilla::Group(CheckGroupID($cgi->param('group_id'))); my $regexp = CheckGroupRegexp($cgi->param('regexp')); - $dbh->bz_lock_tables('groups WRITE', 'profiles READ', - 'user_group_map WRITE'); + $dbh->bz_start_transaction(); my $users = $group->members_direct(); my $sth_delete = $dbh->prepare( @@ -517,7 +516,7 @@ if ($action eq 'remove_regexp') { push(@deleted, $member); } } - $dbh->bz_unlock_tables(); + $dbh->bz_commit_transaction(); $vars->{'users'} = \@deleted; $vars->{'regexp'} = $regexp; @@ -543,13 +542,7 @@ sub doGroupChanges { my $cgi = Bugzilla->cgi; my $dbh = Bugzilla->dbh; - $dbh->bz_lock_tables('groups WRITE', 'group_group_map WRITE', - 'bug_group_map WRITE', 'user_group_map WRITE', - 'group_control_map READ', 'bugs READ', 'profiles READ', - # Due to the way Bugzilla::Config::BugFields::get_param_list() - # works, we need to lock these tables too. - 'priority READ', 'bug_severity READ', 'rep_platform READ', - 'op_sys READ'); + $dbh->bz_start_transaction(); # Check that the given group ID is valid and make a Group. my $group = new Bugzilla::Group(CheckGroupID($cgi->param('group_id'))); @@ -603,7 +596,7 @@ sub doGroupChanges { $data->[0], $data->[1]); } - $dbh->bz_unlock_tables(); + $dbh->bz_commit_transaction(); return $changes; } |