From b2b03103bba9927d5f1b123e0ad7ae1e04149dc8 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sun, 25 Jan 2009 12:42:51 +0000 Subject: Bug 471880: More scripts should use the shadow DB instead of the master DB - Patch by Frédéric Buclin r=mkanat a=LpSolit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- request.cgi | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'request.cgi') diff --git a/request.cgi b/request.cgi index 666b74b17..5dfb76ddb 100755 --- a/request.cgi +++ b/request.cgi @@ -42,6 +42,8 @@ use Bugzilla::Component; # Make sure the user is logged in. my $user = Bugzilla->login(); my $cgi = Bugzilla->cgi; +# Force the script to run against the shadow DB. We already validated credentials. +Bugzilla->switch_to_shadow_db; my $template = Bugzilla->template; my $action = $cgi->param('action') || ''; @@ -94,7 +96,6 @@ exit; sub queue { my $cgi = Bugzilla->cgi; - # There are some user privilege checks to do. We do them against the main DB. my $dbh = Bugzilla->dbh; my $template = Bugzilla->template; my $user = Bugzilla->user; @@ -164,9 +165,7 @@ sub queue { $query .= " AND flags.status = '?' " unless $status; # The set of criteria by which we filter records to display in the queue. - # We now move to the shadow DB to query the DB. my @criteria = (); - $dbh = Bugzilla->switch_to_shadow_db; # A list of columns to exclude from the report because the report conditions # limit the data being displayed to exact matches for those columns. @@ -304,9 +303,6 @@ sub queue { my $flagtypes = get_flag_types(); push(@types, @$flagtypes); - # We move back to the main DB to get the list of products the user can see. - $dbh = Bugzilla->switch_to_main_db; - $vars->{'products'} = $user->get_selectable_products; $vars->{'excluded_columns'} = \@excluded_columns; $vars->{'group_field'} = $form_group; -- cgit v1.2.3-24-g4f1b