From: David Walsh Date: Tue, 6 Jun 2017 17:52:36 +0000 (-0500) Subject: Bug 1370378 - Add Phabricator Extension enabled flag to instantly toggle off all... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f02c8bd226d332f6d0ef7d8c55fbace94c055d20;p=thirdparty%2Fbugzilla.git Bug 1370378 - Add Phabricator Extension enabled flag to instantly toggle off all Phabricator syncing. r?dkl --- 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 @@ -19,6 +19,11 @@ sub get_param_list { my ($class) = @_; my @params = ( + { + name => 'phabricator_enabled', + type => 'b', + default => 0 + }, { name => 'phabricator_base_uri', type => 't', 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',