summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-10-14 21:06:18 +0200
committerFlorian Pritz <bluewind@xinu.at>2018-12-07 00:25:53 +0100
commit8c3fdaa797bc941aeb07ec8dc36361d6f34ccc98 (patch)
treee176ab54eaf501bf842832a939f4ceaa59a762d8 /extensions
parentf2ff085f8a2062f935a0116d18975c3c21ec4b64 (diff)
downloadbugzilla-8c3fdaa797bc941aeb07ec8dc36361d6f34ccc98.tar.gz
bugzilla-8c3fdaa797bc941aeb07ec8dc36361d6f34ccc98.tar.xz
add a default security group
Diffstat (limited to 'extensions')
-rw-r--r--extensions/BMO/Extension.pm37
1 files changed, 20 insertions, 17 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm
index f4fb6fa32..81b5bd8c4 100644
--- a/extensions/BMO/Extension.pm
+++ b/extensions/BMO/Extension.pm
@@ -29,6 +29,7 @@ use warnings;
use base qw(Bugzilla::Extension);
+use Bugzilla::Logging;
use Bugzilla::Bug;
use Bugzilla::BugMail;
use Bugzilla::Config::Common qw(check_group get_all_group_names);
@@ -178,7 +179,7 @@ sub template_before_process {
}
if ($file =~ /^admin\/products\/(create|edit)\./) {
- my $product = $vars->{product};
+ my $product = $vars->{product};
my $security_groups = Bugzilla::Group->match({isbuggroup => 1, isactive => 1});
if ($product) {
@@ -367,7 +368,7 @@ sub format_bounty_attachment_description {
sub parse_bounty_attachment_description {
my ($desc) = @_;
- my %map = (true => 1, false => 0);
+ my %map = (true => 1, false => 0);
my $date = qr/\d{4}-\d{2}-\d{2}/;
$desc =~ m!
^
@@ -383,12 +384,12 @@ sub parse_bounty_attachment_description {
return {
reporter_email => $+{reporter_email} // '',
- amount_paid => $+{amount_paid} // '',
- reported_date => $+{reported_date} // '',
- fixed_date => $+{fixed_date} // '',
- awarded_date => $+{awarded_date} // '',
- publish => $map{$+{publish} // 'false'},
- credit => [grep {$_} split(/\s*,\s*/, $+{credits})]
+ amount_paid => $+{amount_paid} // '',
+ reported_date => $+{reported_date} // '',
+ fixed_date => $+{fixed_date} // '',
+ awarded_date => $+{awarded_date} // '',
+ publish => $map{$+{publish} // 'false'},
+ credit => [grep {$_} split(/\s*,\s*/, $+{credits})]
};
}
@@ -962,7 +963,7 @@ sub _bug_reporters_hw_os {
my ($self) = @_;
return $self->{ua_hw_os} if exists $self->{ua_hw_os};
my $memcached = Bugzilla->memcached;
- my $hw_os = $memcached->get({key => 'bug.ua.' . $self->id});
+ my $hw_os = $memcached->get({key => 'bug.ua.' . $self->id});
if (!$hw_os) {
(my $ua)
= Bugzilla->dbh->selectrow_array(
@@ -1026,7 +1027,7 @@ sub _bug_missing_sec_approval {
return 0 unless @$flags;
my $nightly = last_value { $_->name !~ /_esr\d+$/ } @$flags;
- my $set = 0;
+ my $set = 0;
foreach my $flag (@$flags) {
my $value = $flag->bug_flag($self->id)->value;
next if $value eq '---';
@@ -1943,7 +1944,7 @@ sub _fix_encoding {
return if $part->parts > 1;
# nothing to do if the part already has a charset
- my $ct = parse_content_type($part->content_type);
+ my $ct = parse_content_type($part->content_type);
my $charset = $ct->{attributes}{charset} ? $ct->{attributes}{charset} : '';
return unless !$charset || $charset eq 'us-ascii';
@@ -2204,7 +2205,7 @@ sub _post_dev_engagement {
# be pasted directly into google docs.
my $values = html_quote(join("\t", @attach_values));
- my $data = <<EOF;
+ my $data = <<EOF;
<!doctype html>
<html>
<head>
@@ -2638,10 +2639,12 @@ sub _default_security_group {
}
sub _default_security_group_obj {
- my $group_id = $_[0]->{security_group_id};
+ my ($self) = @_;
+ my $group_id = $self->{security_group_id};
if (!$group_id) {
- return Bugzilla::Group->new(
- {name => Bugzilla->params->{insidergroup}, cache => 1});
+ WARN(sprintf "%s (%d) lacks a default security_group_id",
+ $self->name, $self->id);
+ return Bugzilla::Group->check({name => 'bz_private', cache => 1});
}
return Bugzilla::Group->new({id => $group_id, cache => 1});
}
@@ -2758,7 +2761,7 @@ sub bug_comments {
my $can_delete
= Bugzilla->user->in_group(Bugzilla->params->{delete_comments_group});
my $comments = $args->{comments};
- my @deleted = grep { $_->has_tag('deleted') } @$comments;
+ my @deleted = grep { $_->has_tag('deleted') } @$comments;
while (my $comment = pop @deleted) {
for (my $i = scalar(@$comments) - 1; $i >= 0; $i--) {
if ($comment == $comments->[$i]) {
@@ -2780,7 +2783,7 @@ sub bug_comments {
sub _split_crash_signature {
my ($self, $vars) = @_;
- my $bug = $vars->{bug} // return;
+ my $bug = $vars->{bug} // return;
my $crash_signature = $bug->cf_crash_signature // return;
return [grep {/\S/}
extract_multiple($crash_signature, [sub { extract_bracketed($_[0], '[]') }])];