]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1370378 - Add Phabricator Extension enabled flag to instantly toggle off all...
authorDavid Walsh <davidwalsh83@gmail.com>
Tue, 6 Jun 2017 17:52:36 +0000 (12:52 -0500)
committerDavid Walsh <davidwalsh83@gmail.com>
Tue, 6 Jun 2017 19:20:37 +0000 (14:20 -0500)
extensions/PhabBugz/Extension.pm
extensions/PhabBugz/bin/update_project_members.pl
extensions/PhabBugz/lib/Config.pm
extensions/PhabBugz/template/en/default/admin/params/phabbugz.html.tmpl

index 1ba1609f587f6c05b1d33a9d260374461747a0fc..6c81e17ebd00a5bfedab97a30cbf7b67ca43cfd0 100644 (file)
@@ -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;
 
index 56c471fe8e837f22d4e23d49dcc8965703737e16..0aa51e17d6b78d076fa3241935732ad299befe6d 100755 (executable)
@@ -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');
index a0b7ef2e5ac4eb41e4d6ba5000bb534380f63b8f..85ba37e74ba5a0d4a12b748d9c33b7e2d49ea806 100644 (file)
@@ -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',
index 6eb16d993780a0938029a6286a18873f6a060f91..d67839cc8d5ce992ae1078541e821dc3529a20cd 100644 (file)
@@ -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',