diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-10-14 18:19:50 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-10-14 18:19:50 +0200 |
commit | ce00a61057535d49aa0e83181a1d317d7842571b (patch) | |
tree | 280243de9ff791449fb2c82f3f0f2b9bd931d5b2 /extensions/Persona/Extension.pm | |
parent | 6367a26da4093a8379e370ef328e9507c98b2e7e (diff) | |
parent | 6657fa9f5210d5b5a9b14c0cba6882bd56232054 (diff) | |
download | bugzilla-ce00a61057535d49aa0e83181a1d317d7842571b.tar.gz bugzilla-ce00a61057535d49aa0e83181a1d317d7842571b.tar.xz |
Merge remote-tracking branch 'bmo/master'
Diffstat (limited to 'extensions/Persona/Extension.pm')
-rw-r--r-- | extensions/Persona/Extension.pm | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/extensions/Persona/Extension.pm b/extensions/Persona/Extension.pm deleted file mode 100644 index f94c54446..000000000 --- a/extensions/Persona/Extension.pm +++ /dev/null @@ -1,86 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -package Bugzilla::Extension::Persona; - -use 5.10.1; -use strict; -use warnings; - -use base qw(Bugzilla::Extension); - -use Bugzilla::Config qw(SetParam write_params); - -our $VERSION = '0.01'; - -sub install_update_db { - # The extension changed from BrowserID to Persona - # so we need to update user_info_class if this system - # was using BrowserID for verification. - my $params = Bugzilla->params || Bugzilla::Config::read_param_file(); - my $user_info_class = $params->{'user_info_class'}; - if ($user_info_class =~ /BrowserID/) { - $user_info_class =~ s/BrowserID/Persona/; - SetParam('user_info_class', $user_info_class); - write_params(); - } -} - -sub auth_login_methods { - my ($self, $args) = @_; - my $modules = $args->{'modules'}; - if (exists($modules->{'Persona'})) { - $modules->{'Persona'} = 'Bugzilla/Extension/Persona/Login.pm'; - } -} - -sub config_modify_panels { - my ($self, $args) = @_; - my $panels = $args->{'panels'}; - my $auth_panel_params = $panels->{'auth'}->{'params'}; - - my ($user_info_class) = - grep { $_->{'name'} eq 'user_info_class' } @$auth_panel_params; - - if ($user_info_class) { - push(@{ $user_info_class->{'choices'} }, "Persona,CGI"); - } - - # The extension changed from BrowserID to Persona - # so we need to retain the current values for the new - # params that will be created. - my $params = Bugzilla->params || Bugzilla::Config::read_param_file(); - my $verify_url = $params->{'browserid_verify_url'}; - my $includejs_url = $params->{'browserid_includejs_url'}; - if ($verify_url && $includejs_url) { - foreach my $param (@{ $panels->{'persona'}->{'params'} }) { - if ($param->{'name'} eq 'persona_verify_url') { - $param->{'default'} = $verify_url; - } - if ($param->{'name'} eq 'persona_includejs_url') { - $param->{'default'} = $includejs_url; - } - } - } -} - -sub attachment_should_redirect_login { - my ($self, $args) = @_; - my $cgi = Bugzilla->cgi; - - if ($cgi->param("persona_assertion")) { - ${$args->{do_redirect}} = 1; - } -} - -sub config_add_panels { - my ($self, $args) = @_; - my $modules = $args->{panel_modules}; - $modules->{Persona} = "Bugzilla::Extension::Persona::Config"; -} - -__PACKAGE__->NAME; |