summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Walsh <davidwalsh83@gmail.com>2017-06-06 19:52:36 +0200
committerDavid Walsh <davidwalsh83@gmail.com>2017-06-06 21:20:37 +0200
commitf02c8bd226d332f6d0ef7d8c55fbace94c055d20 (patch)
tree0d708a1f375a1a6cc994ed34d37223773129cc19
parent8de4392bb242d4115c967c1424dc00bee39e939a (diff)
downloadbugzilla-f02c8bd226d332f6d0ef7d8c55fbace94c055d20.tar.gz
bugzilla-f02c8bd226d332f6d0ef7d8c55fbace94c055d20.tar.xz
Bug 1370378 - Add Phabricator Extension enabled flag to instantly toggle off all Phabricator syncing. r?dkl
-rw-r--r--extensions/PhabBugz/Extension.pm2
-rwxr-xr-xextensions/PhabBugz/bin/update_project_members.pl4
-rw-r--r--extensions/PhabBugz/lib/Config.pm5
-rw-r--r--extensions/PhabBugz/template/en/default/admin/params/phabbugz.html.tmpl1
4 files changed, 12 insertions, 0 deletions
diff --git a/extensions/PhabBugz/Extension.pm b/extensions/PhabBugz/Extension.pm
index 1ba1609f5..6c81e17eb 100644
--- a/extensions/PhabBugz/Extension.pm
+++ b/extensions/PhabBugz/Extension.pm
@@ -22,9 +22,11 @@ sub config_add_panels {
sub auth_delegation_confirm {
my ($self, $args) = @_;
+ my $phab_enabled = Bugzilla->params->{phabricator_enabled};
my $phab_callback_url = Bugzilla->params->{phabricator_auth_callback_url};
my $phab_app_id = Bugzilla->params->{phabricator_app_id};
+ return unless $phab_enabled;
return unless $phab_callback_url;
return unless $phab_app_id;
diff --git a/extensions/PhabBugz/bin/update_project_members.pl b/extensions/PhabBugz/bin/update_project_members.pl
index 56c471fe8..0aa51e17d 100755
--- a/extensions/PhabBugz/bin/update_project_members.pl
+++ b/extensions/PhabBugz/bin/update_project_members.pl
@@ -27,6 +27,10 @@ Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
my ($phab_uri, $phab_api_key, $phab_sync_groups, $ua);
+if (!Bugzilla->params->{phabricator_enabled}) {
+ exit;
+}
+
# Sanity checks
unless ($phab_uri = Bugzilla->params->{phabricator_base_uri}) {
ThrowUserError('invalid_phabricator_uri');
diff --git a/extensions/PhabBugz/lib/Config.pm b/extensions/PhabBugz/lib/Config.pm
index a0b7ef2e5..85ba37e74 100644
--- a/extensions/PhabBugz/lib/Config.pm
+++ b/extensions/PhabBugz/lib/Config.pm
@@ -20,6 +20,11 @@ sub get_param_list {
my @params = (
{
+ name => 'phabricator_enabled',
+ type => 'b',
+ default => 0
+ },
+ {
name => 'phabricator_base_uri',
type => 't',
default => '',
diff --git a/extensions/PhabBugz/template/en/default/admin/params/phabbugz.html.tmpl b/extensions/PhabBugz/template/en/default/admin/params/phabbugz.html.tmpl
index 6eb16d993..d67839cc8 100644
--- a/extensions/PhabBugz/template/en/default/admin/params/phabbugz.html.tmpl
+++ b/extensions/PhabBugz/template/en/default/admin/params/phabbugz.html.tmpl
@@ -13,6 +13,7 @@
[%
param_descs = {
+ phabricator_enabled => 'Enable Phabricator Integration',
phabricator_base_uri => 'Phabricator Base URI',
phabricator_api_key => 'Phabricator User API Key',
phabricator_sync_groups => 'Comma delimited list of Bugzilla groups to sync to Phabricator projects',