diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-03-10 17:59:51 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-03-10 18:08:36 +0100 |
commit | 8ba3f387cd09504cd0ca357b3557d705d044633b (patch) | |
tree | f99c82609dc493ba3c288a81a5ba152ae85d947e /Bugzilla.pm | |
parent | 2056caa180f907c6e5727954547dfd928cf6a360 (diff) | |
download | bugzilla-8ba3f387cd09504cd0ca357b3557d705d044633b.tar.gz bugzilla-8ba3f387cd09504cd0ca357b3557d705d044633b.tar.xz |
initial changes, no templates
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r-- | Bugzilla.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm index 4a3dcb114..17fefa447 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -57,6 +57,7 @@ use File::Basename; use File::Spec::Functions; use Safe; use Sys::Syslog qw(:DEFAULT); +use List::Util qw(any); use JSON::XS qw(decode_json); use parent qw(Bugzilla::CPAN); @@ -868,6 +869,20 @@ sub check_rate_limit { } } +# called from the verify version, component, and group page. +# if we're making a group invalid, stuff the default group into the cgi param +# to make it checked by default. +sub check_default_product_security_group { + my ($class, $product, $invalid_groups, $optional_group_controls) = @_; + return unless my $group = $product->default_security_group_obj; + if (@$invalid_groups) { + my $cgi = $class->cgi; + my @groups = $cgi->param('groups'); + push @groups, $group->name unless any { $_ eq $group->name } @groups; + $cgi->param('groups', @groups); + } +} + # Private methods # Per-process cleanup. Note that this is a plain subroutine, not a method, |