summaryrefslogtreecommitdiffstats
path: root/request.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2009-01-25 13:42:51 +0100
committerlpsolit%gmail.com <>2009-01-25 13:42:51 +0100
commitb2b03103bba9927d5f1b123e0ad7ae1e04149dc8 (patch)
treee4845cde1af1ada8ca0d43e8c42be6d589e9a936 /request.cgi
parent812ad9b3515aff6d9d870c2a11845b7416e40288 (diff)
downloadbugzilla-b2b03103bba9927d5f1b123e0ad7ae1e04149dc8.tar.gz
bugzilla-b2b03103bba9927d5f1b123e0ad7ae1e04149dc8.tar.xz
Bug 471880: More scripts should use the shadow DB instead of the master DB - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=LpSolit
Diffstat (limited to 'request.cgi')
-rwxr-xr-xrequest.cgi8
1 files changed, 2 insertions, 6 deletions
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;