aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-03-05 12:57:53 +0800
committerByron Jones <glob@mozilla.com>2015-03-05 12:57:53 +0800
commitc1fa559e16cbaa5e7a3133f7ea0b086ea00ba650 (patch)
tree063acc63c823e66b4ab8cd04802139548905a1ee /Bugzilla.pm
parentdbc7a21e1b96a9c57b6a53af78a4d467c9a7672d (diff)
downloadbugs-c1fa559e16cbaa5e7a3133f7ea0b086ea00ba650.tar
bugs-c1fa559e16cbaa5e7a3133f7ea0b086ea00ba650.tar.gz
bugs-c1fa559e16cbaa5e7a3133f7ea0b086ea00ba650.tar.bz2
bugs-c1fa559e16cbaa5e7a3133f7ea0b086ea00ba650.tar.xz
bugs-c1fa559e16cbaa5e7a3133f7ea0b086ea00ba650.zip
Bug 1128853: Bugzilla shouldn't try to write API tokens into the shadow DB
r=dkl,a=glob
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 8e1f8886f..e27be0f7f 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -530,6 +530,11 @@ sub switch_to_main_db {
return $class->dbh_main;
}
+sub is_shadow_db {
+ my $class = shift;
+ return $class->request_cache->{dbh} != $class->dbh_main;
+}
+
sub fields {
my ($class, $criteria) = @_;
$criteria ||= {};
@@ -935,6 +940,12 @@ Switch from using the main database to using the shadow database.
Change the database object to refer to the main database.
+=item C<is_shadow_db>
+
+Returns true if the currently active database is the shadow database.
+Returns false if a the currently active database is the man database, or if a
+shadow database is not configured or enabled.
+
=item C<params>
The current Parameters of Bugzilla, as a hashref. If C<data/params.json>