diff options
author | Perl Tidy <perltidy@bugzilla.org> | 2018-12-05 21:38:52 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-12-05 23:49:08 +0100 |
commit | 8ec8da0491ad89604700b3e29a227966f6d84ba1 (patch) | |
tree | 9d270f173330ca19700e0ba9f2ee931300646de1 /Bugzilla/Config | |
parent | a7bb5a65b71644d9efce5fed783ed545b9336548 (diff) | |
download | bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.gz bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.xz |
no bug - reformat all the code using the new perltidy rules
Diffstat (limited to 'Bugzilla/Config')
-rw-r--r-- | Bugzilla/Config/Admin.pm | 107 | ||||
-rw-r--r-- | Bugzilla/Config/Advanced.pm | 30 | ||||
-rw-r--r-- | Bugzilla/Config/Attachment.pm | 106 | ||||
-rw-r--r-- | Bugzilla/Config/Auth.pm | 400 | ||||
-rw-r--r-- | Bugzilla/Config/BugChange.pm | 98 | ||||
-rw-r--r-- | Bugzilla/Config/BugFields.pm | 138 | ||||
-rw-r--r-- | Bugzilla/Config/Common.pm | 451 | ||||
-rw-r--r-- | Bugzilla/Config/DependencyGraph.pm | 18 | ||||
-rw-r--r-- | Bugzilla/Config/Elastic.pm | 22 | ||||
-rw-r--r-- | Bugzilla/Config/General.pm | 77 | ||||
-rw-r--r-- | Bugzilla/Config/GroupSecurity.pm | 129 | ||||
-rw-r--r-- | Bugzilla/Config/LDAP.pm | 50 | ||||
-rw-r--r-- | Bugzilla/Config/MTA.pm | 97 | ||||
-rw-r--r-- | Bugzilla/Config/PatchViewer.pm | 38 | ||||
-rw-r--r-- | Bugzilla/Config/Query.pm | 88 | ||||
-rw-r--r-- | Bugzilla/Config/RADIUS.pm | 38 | ||||
-rw-r--r-- | Bugzilla/Config/Reports.pm | 28 | ||||
-rw-r--r-- | Bugzilla/Config/ShadowDB.pm | 49 | ||||
-rw-r--r-- | Bugzilla/Config/UserMatch.pm | 44 |
19 files changed, 857 insertions, 1151 deletions
diff --git a/Bugzilla/Config/Admin.pm b/Bugzilla/Config/Admin.pm index ac1c4ca0e..cae4cb25d 100644 --- a/Bugzilla/Config/Admin.pm +++ b/Bugzilla/Config/Admin.pm @@ -19,78 +19,59 @@ use Scalar::Util qw(looks_like_number); our $sortkey = 200; sub get_param_list { - my $class = shift; - my @param_list = ( - { - name => 'allowbugdeletion', - type => 'b', - default => 0 - }, - - { - name => 'allowemailchange', - type => 'b', - default => 1 - }, - - { - name => 'allowuserdeletion', - type => 'b', - default => 0 - }, - - { - name => 'last_visit_keep_days', - type => 't', - default => 10, - checker => \&check_numeric - }, - - { - name => 'rate_limit_active', - type => 'b', - default => 1, - }, - - { - name => 'rate_limit_rules', - type => 'l', - default => '{"get_bug": [75, 60], "show_bug": [75, 60], "github": [10, 60]}', - checker => \&check_rate_limit_rules, - updater => \&update_rate_limit_rules, - }, - - { - name => 'log_user_requests', - type => 'b', - default => 0, - } - ); - return @param_list; + my $class = shift; + my @param_list = ( + {name => 'allowbugdeletion', type => 'b', default => 0}, + + {name => 'allowemailchange', type => 'b', default => 1}, + + {name => 'allowuserdeletion', type => 'b', default => 0}, + + { + name => 'last_visit_keep_days', + type => 't', + default => 10, + checker => \&check_numeric + }, + + {name => 'rate_limit_active', type => 'b', default => 1,}, + + { + name => 'rate_limit_rules', + type => 'l', + default => '{"get_bug": [75, 60], "show_bug": [75, 60], "github": [10, 60]}', + checker => \&check_rate_limit_rules, + updater => \&update_rate_limit_rules, + }, + + {name => 'log_user_requests', type => 'b', default => 0,} + ); + return @param_list; } sub check_rate_limit_rules { - my $rules = shift; + my $rules = shift; - my $val = eval { decode_json($rules) }; - return "failed to parse json" unless defined $val; - return "value is not HASH" unless ref $val && ref($val) eq 'HASH'; - return "rules are invalid" unless all { - ref($_) eq 'ARRAY' && looks_like_number( $_->[0] ) && looks_like_number( $_->[1] ) - } values %$val; + my $val = eval { decode_json($rules) }; + return "failed to parse json" unless defined $val; + return "value is not HASH" unless ref $val && ref($val) eq 'HASH'; + return "rules are invalid" unless all { + ref($_) eq 'ARRAY' && looks_like_number($_->[0]) && looks_like_number($_->[1]) + } + values %$val; - foreach my $required (qw( show_bug get_bug github )) { - return "missing $required" unless exists $val->{$required}; - } + foreach my $required (qw( show_bug get_bug github )) { + return "missing $required" unless exists $val->{$required}; + } - return ""; + return ""; } sub update_rate_limit_rules { - my ($rules) = @_; - my $val = decode_json($rules); - $val->{github} = [10, 60]; - return encode_json($val); + my ($rules) = @_; + my $val = decode_json($rules); + $val->{github} = [10, 60]; + return encode_json($val); } 1; diff --git a/Bugzilla/Config/Advanced.pm b/Bugzilla/Config/Advanced.pm index 398f02701..7b76944e1 100644 --- a/Bugzilla/Config/Advanced.pm +++ b/Bugzilla/Config/Advanced.pm @@ -17,25 +17,17 @@ use Bugzilla::Util qw(validate_ip); our $sortkey = 1700; use constant get_param_list => ( - { - name => 'proxy_url', - type => 't', - default => '' - }, - - { - name => 'strict_transport_security', - type => 's', - choices => [ 'off', 'this_domain_only', 'include_subdomains' ], - default => 'off', - checker => \&check_multi - }, - - { - name => 'disable_bug_updates', - type => 'b', - default => 0 - }, + {name => 'proxy_url', type => 't', default => ''}, + + { + name => 'strict_transport_security', + type => 's', + choices => ['off', 'this_domain_only', 'include_subdomains'], + default => 'off', + checker => \&check_multi + }, + + {name => 'disable_bug_updates', type => 'b', default => 0}, ); 1; diff --git a/Bugzilla/Config/Attachment.pm b/Bugzilla/Config/Attachment.pm index c3dbd03ed..821996eba 100644 --- a/Bugzilla/Config/Attachment.pm +++ b/Bugzilla/Config/Attachment.pm @@ -16,77 +16,57 @@ use Bugzilla::Config::Common; our $sortkey = 400; sub get_param_list { - my $class = shift; - my @param_list = ( - { - name => 'allow_attachment_display', - type => 'b', - default => 0 - }, - { - name => 'allow_attachment_deletion', - type => 'b', - default => 0 - }, - { - name => 'maxattachmentsize', - type => 't', - default => '1000', - checker => \&check_maxattachmentsize - }, - { - name => 'attachment_storage', - type => 's', - choices => [ 'database', 'filesystem', 's3' ], - default => 'database', - checker => \&check_storage - }, - { - name => 's3_bucket', - type => 't', - default => '', - }, - { - name => 'aws_access_key_id', - type => 't', - default => '', - }, - { - name => 'aws_secret_access_key', - type => 't', - default => '', - }, - ); - return @param_list; + my $class = shift; + my @param_list = ( + {name => 'allow_attachment_display', type => 'b', default => 0}, + {name => 'allow_attachment_deletion', type => 'b', default => 0}, + { + name => 'maxattachmentsize', + type => 't', + default => '1000', + checker => \&check_maxattachmentsize + }, + { + name => 'attachment_storage', + type => 's', + choices => ['database', 'filesystem', 's3'], + default => 'database', + checker => \&check_storage + }, + {name => 's3_bucket', type => 't', default => '',}, + {name => 'aws_access_key_id', type => 't', default => '',}, + {name => 'aws_secret_access_key', type => 't', default => '',}, + ); + return @param_list; } sub check_params { - my ( $class, $params ) = @_; - return '' unless $params->{attachment_storage} eq 's3'; + my ($class, $params) = @_; + return '' unless $params->{attachment_storage} eq 's3'; - if ( $params->{s3_bucket} eq '' - || $params->{aws_access_key_id} eq '' - || $params->{aws_secret_access_key} eq '' ) - { - return - "You must set s3_bucket, aws_access_key_id, and aws_secret_access_key when attachment_storage is set to S3"; - } - return ''; + if ( $params->{s3_bucket} eq '' + || $params->{aws_access_key_id} eq '' + || $params->{aws_secret_access_key} eq '') + { + return + "You must set s3_bucket, aws_access_key_id, and aws_secret_access_key when attachment_storage is set to S3"; + } + return ''; } sub check_storage { - my ( $value, $param ) = (@_); - my $check_multi = check_multi( $value, $param ); - return $check_multi if $check_multi; + my ($value, $param) = (@_); + my $check_multi = check_multi($value, $param); + return $check_multi if $check_multi; - if ( $value eq 's3' ) { - return Bugzilla->feature('s3') - ? '' - : 'The perl modules required for S3 support are not installed'; - } - else { - return ''; - } + if ($value eq 's3') { + return Bugzilla->feature('s3') + ? '' + : 'The perl modules required for S3 support are not installed'; + } + else { + return ''; + } } 1; diff --git a/Bugzilla/Config/Auth.pm b/Bugzilla/Config/Auth.pm index 965d922d7..664c1b263 100644 --- a/Bugzilla/Config/Auth.pm +++ b/Bugzilla/Config/Auth.pm @@ -18,241 +18,195 @@ use Types::Common::Numeric qw(PositiveInt); our $sortkey = 300; sub get_param_list { - my $class = shift; - my @param_list = ( - { - name => 'auth_env_id', - type => 't', - default => '', - }, - - { - name => 'auth_env_email', - type => 't', - default => '', - }, - - { - name => 'auth_env_realname', - type => 't', - default => '', - }, - - # XXX in the future: - # - # user_verify_class and user_info_class should have choices gathered from - # whatever sits in their respective directories - # - # rather than comma-separated lists, these two should eventually become - # arrays, but that requires alterations to editparams first - - { - name => 'user_info_class', - type => 's', - choices => [ 'CGI', 'Env', 'Env,CGI' ], - default => 'CGI', - checker => \&check_multi - }, - - { - name => 'user_verify_class', - type => 'o', - choices => [ 'DB', 'RADIUS', 'LDAP' ], - default => 'DB', - checker => \&check_user_verify_class - }, - - { - name => 'rememberlogin', - type => 's', - choices => [ 'on', 'defaulton', 'defaultoff', 'off' ], - default => 'on', - checker => \&check_multi - }, - - { - name => 'requirelogin', - type => 'b', - default => '0' - }, - - { - name => 'webservice_email_filter', - type => 'b', - default => 0 - }, - - { - name => 'emailregexp', - type => 't', - default => q:^[\\w\\.\\+\\-=]+@[\\w\\.\\-]+\\.[\\w\\-]+$:, - checker => \&check_regexp - }, - - { - name => 'emailregexpdesc', - type => 'l', - default => 'A legal address must contain exactly one \'@\', and at least ' . 'one \'.\' after the @.' - }, - - { - name => 'emailsuffix', - type => 't', - default => '' - }, - - { - name => 'createemailregexp', - type => 't', - default => q:.*:, - checker => \&check_regexp - }, - - { - name => 'password_complexity', - type => 's', - choices => [ 'no_constraints', 'bmo' ], - default => 'no_constraints', - checker => \&check_multi - }, - - { - name => 'password_check_on_login', - type => 'b', - default => '1' - }, - - { - name => 'passwdqc_min', - type => 't', - default => 'undef, 24, 11, 8, 7', - checker => \&_check_passwdqc_min, - }, - - { - name => 'passwdqc_max', - type => 't', - default => '40', - checker => \&_check_passwdqc_max, - }, - - { - name => 'passwdqc_passphrase_words', - type => 't', - default => '3', - checker => \&check_numeric, - }, - - { - name => 'passwdqc_match_length', - type => 't', - default => '4', - checker => \&check_numeric, - }, - - { - name => 'passwdqc_random_bits', - type => 't', - default => '47', - checker => \&_check_passwdqc_random_bits, - }, - - { - name => 'passwdqc_desc', - type => 'l', - default => 'The password must be complex.', - }, - - { - name => 'auth_delegation', - type => 'b', - default => 0, - }, - - { - name => 'duo_host', - type => 't', - default => '', - }, - { - name => 'duo_akey', - type => 't', - default => '', - }, - { - name => 'duo_ikey', - type => 't', - default => '', - }, - { - name => 'duo_skey', - type => 't', - default => '', - }, - - { - name => 'mfa_group', - type => 's', - choices => \&get_all_group_names, - default => '', - checker => \&check_group, - }, - - { - name => 'mfa_group_grace_period', - type => 't', - default => '7', - checker => \&check_numeric, - } - ); - return @param_list; + my $class = shift; + my @param_list = ( + {name => 'auth_env_id', type => 't', default => '',}, + + {name => 'auth_env_email', type => 't', default => '',}, + + {name => 'auth_env_realname', type => 't', default => '',}, + + # XXX in the future: + # + # user_verify_class and user_info_class should have choices gathered from + # whatever sits in their respective directories + # + # rather than comma-separated lists, these two should eventually become + # arrays, but that requires alterations to editparams first + + { + name => 'user_info_class', + type => 's', + choices => ['CGI', 'Env', 'Env,CGI'], + default => 'CGI', + checker => \&check_multi + }, + + { + name => 'user_verify_class', + type => 'o', + choices => ['DB', 'RADIUS', 'LDAP'], + default => 'DB', + checker => \&check_user_verify_class + }, + + { + name => 'rememberlogin', + type => 's', + choices => ['on', 'defaulton', 'defaultoff', 'off'], + default => 'on', + checker => \&check_multi + }, + + {name => 'requirelogin', type => 'b', default => '0'}, + + {name => 'webservice_email_filter', type => 'b', default => 0}, + + { + name => 'emailregexp', + type => 't', + default => q:^[\\w\\.\\+\\-=]+@[\\w\\.\\-]+\\.[\\w\\-]+$:, + checker => \&check_regexp + }, + + { + name => 'emailregexpdesc', + type => 'l', + default => 'A legal address must contain exactly one \'@\', and at least ' + . 'one \'.\' after the @.' + }, + + {name => 'emailsuffix', type => 't', default => ''}, + + { + name => 'createemailregexp', + type => 't', + default => q:.*:, + checker => \&check_regexp + }, + + { + name => 'password_complexity', + type => 's', + choices => ['no_constraints', 'bmo'], + default => 'no_constraints', + checker => \&check_multi + }, + + {name => 'password_check_on_login', type => 'b', default => '1'}, + + { + name => 'passwdqc_min', + type => 't', + default => 'undef, 24, 11, 8, 7', + checker => \&_check_passwdqc_min, + }, + + { + name => 'passwdqc_max', + type => 't', + default => '40', + checker => \&_check_passwdqc_max, + }, + + { + name => 'passwdqc_passphrase_words', + type => 't', + default => '3', + checker => \&check_numeric, + }, + + { + name => 'passwdqc_match_length', + type => 't', + default => '4', + checker => \&check_numeric, + }, + + { + name => 'passwdqc_random_bits', + type => 't', + default => '47', + checker => \&_check_passwdqc_random_bits, + }, + + { + name => 'passwdqc_desc', + type => 'l', + default => 'The password must be complex.', + }, + + {name => 'auth_delegation', type => 'b', default => 0,}, + + {name => 'duo_host', type => 't', default => '',}, + {name => 'duo_akey', type => 't', default => '',}, + {name => 'duo_ikey', type => 't', default => '',}, + {name => 'duo_skey', type => 't', default => '',}, + + { + name => 'mfa_group', + type => 's', + choices => \&get_all_group_names, + default => '', + checker => \&check_group, + }, + + { + name => 'mfa_group_grace_period', + type => 't', + default => '7', + checker => \&check_numeric, + } + ); + return @param_list; } -my $passwdqc_min = Tuple[ - Maybe[PositiveInt], - Maybe[PositiveInt], - Maybe[PositiveInt], - Maybe[PositiveInt], - Maybe[PositiveInt], +my $passwdqc_min = Tuple [ + Maybe [PositiveInt], + Maybe [PositiveInt], + Maybe [PositiveInt], + Maybe [PositiveInt], + Maybe [PositiveInt], ]; sub _check_passwdqc_min { - my ($value) = @_; - my @values = map { $_ eq 'undef' ? undef : $_ } split( /\s*,\s*/, $value ); - - unless ( $passwdqc_min->check( \@values ) ) { - return "must be list of five values, that are either integers > 0 or undef"; + my ($value) = @_; + my @values = map { $_ eq 'undef' ? undef : $_ } split(/\s*,\s*/, $value); + + unless ($passwdqc_min->check(\@values)) { + return "must be list of five values, that are either integers > 0 or undef"; + } + + my ($max, $max_pos); + my $pos = 0; + foreach my $value (@values) { + if (defined $max && defined $value) { + if ($value > $max) { + return "Int$pos is larger than Int$max_pos ($max)"; + } } - - my ( $max, $max_pos ); - my $pos = 0; - foreach my $value (@values) { - if ( defined $max && defined $value ) { - if ( $value > $max ) { - return "Int$pos is larger than Int$max_pos ($max)"; - } - } - elsif ( defined $value ) { - $max = $value; - $max_pos = $pos; - } - $pos++; + elsif (defined $value) { + $max = $value; + $max_pos = $pos; } - return ""; + $pos++; + } + return ""; } sub _check_passwdqc_max { - my ($value) = @_; - return "must be a positive integer" unless PositiveInt->check($value); - return "must be greater than 8" unless $value > 8; - return ""; + my ($value) = @_; + return "must be a positive integer" unless PositiveInt->check($value); + return "must be greater than 8" unless $value > 8; + return ""; } sub _check_passwdqc_random_bits { - my ($value) = @_; - return "must be a positive integer" unless PositiveInt->check($value); - return "must be between 24 and 85 inclusive" unless $value >= 24 && $value <= 85; - return ""; + my ($value) = @_; + return "must be a positive integer" unless PositiveInt->check($value); + return "must be between 24 and 85 inclusive" + unless $value >= 24 && $value <= 85; + return ""; } -1;
\ No newline at end of file +1; diff --git a/Bugzilla/Config/BugChange.pm b/Bugzilla/Config/BugChange.pm index f9c33512a..ad1cafefc 100644 --- a/Bugzilla/Config/BugChange.pm +++ b/Bugzilla/Config/BugChange.pm @@ -17,67 +17,43 @@ use Bugzilla::Status; our $sortkey = 500; sub get_param_list { - my $class = shift; - - # Hardcoded bug statuses which existed before Bugzilla 3.1. - my @closed_bug_statuses = ( 'RESOLVED', 'VERIFIED', 'CLOSED' ); - - # If we are upgrading from 3.0 or older, bug statuses are not customisable - # and bug_status.is_open is not yet defined (hence the eval), so we use - # the bug statuses above as they are still hardcoded. - eval { - my @current_closed_states = map { $_->name } closed_bug_statuses(); - - # If no closed state was found, use the default list above. - @closed_bug_statuses = @current_closed_states if scalar(@current_closed_states); - }; - - my @param_list = ( - { - name => 'duplicate_or_move_bug_status', - type => 's', - choices => \@closed_bug_statuses, - default => $closed_bug_statuses[0], - checker => \&check_bug_status - }, - - { - name => 'letsubmitterchoosepriority', - type => 'b', - default => 1 - }, - - { - name => 'letsubmitterchoosemilestone', - type => 'b', - default => 1 - }, - - { - name => 'musthavemilestoneonaccept', - type => 'b', - default => 0 - }, - - { - name => 'commentonchange_resolution', - type => 'b', - default => 0 - }, - - { - name => 'commentonduplicate', - type => 'b', - default => 0 - }, - - { - name => 'noresolveonopenblockers', - type => 'b', - default => 0, - } - ); - return @param_list; + my $class = shift; + + # Hardcoded bug statuses which existed before Bugzilla 3.1. + my @closed_bug_statuses = ('RESOLVED', 'VERIFIED', 'CLOSED'); + + # If we are upgrading from 3.0 or older, bug statuses are not customisable + # and bug_status.is_open is not yet defined (hence the eval), so we use + # the bug statuses above as they are still hardcoded. + eval { + my @current_closed_states = map { $_->name } closed_bug_statuses(); + + # If no closed state was found, use the default list above. + @closed_bug_statuses = @current_closed_states if scalar(@current_closed_states); + }; + + my @param_list = ( + { + name => 'duplicate_or_move_bug_status', + type => 's', + choices => \@closed_bug_statuses, + default => $closed_bug_statuses[0], + checker => \&check_bug_status + }, + + {name => 'letsubmitterchoosepriority', type => 'b', default => 1}, + + {name => 'letsubmitterchoosemilestone', type => 'b', default => 1}, + + {name => 'musthavemilestoneonaccept', type => 'b', default => 0}, + + {name => 'commentonchange_resolution', type => 'b', default => 0}, + + {name => 'commentonduplicate', type => 'b', default => 0}, + + {name => 'noresolveonopenblockers', type => 'b', default => 0,} + ); + return @param_list; } 1; diff --git a/Bugzilla/Config/BugFields.pm b/Bugzilla/Config/BugFields.pm index 94a16b7c2..87ecc6122 100644 --- a/Bugzilla/Config/BugFields.pm +++ b/Bugzilla/Config/BugFields.pm @@ -17,89 +17,61 @@ use Bugzilla::Field; our $sortkey = 600; sub get_param_list { - my $class = shift; - - my @legal_priorities = @{ get_legal_field_values('priority') }; - my @legal_severities = @{ get_legal_field_values('bug_severity') }; - my @legal_platforms = @{ get_legal_field_values('rep_platform') }; - my @legal_OS = @{ get_legal_field_values('op_sys') }; - - my @param_list = ( - { - name => 'useclassification', - type => 'b', - default => 0 - }, - - { - name => 'usetargetmilestone', - type => 'b', - default => 0 - }, - - { - name => 'useqacontact', - type => 'b', - default => 0 - }, - - { - name => 'usestatuswhiteboard', - type => 'b', - default => 0 - }, - - { - name => 'usebugaliases', - type => 'b', - default => 0 - }, - - { - name => 'use_see_also', - type => 'b', - default => 1 - }, - - { - name => 'defaultpriority', - type => 's', - choices => \@legal_priorities, - default => $legal_priorities[-1], - checker => \&check_priority - }, - - { - name => 'defaultseverity', - type => 's', - choices => \@legal_severities, - default => $legal_severities[-1], - checker => \&check_severity - }, - - { - name => 'defaultplatform', - type => 's', - choices => [ '', @legal_platforms ], - default => '', - checker => \&check_platform - }, - - { - name => 'defaultopsys', - type => 's', - choices => [ '', @legal_OS ], - default => '', - checker => \&check_opsys - }, - - { - name => 'collapsed_comment_tags', - type => 't', - default => 'obsolete, spam', - } - ); - return @param_list; + my $class = shift; + + my @legal_priorities = @{get_legal_field_values('priority')}; + my @legal_severities = @{get_legal_field_values('bug_severity')}; + my @legal_platforms = @{get_legal_field_values('rep_platform')}; + my @legal_OS = @{get_legal_field_values('op_sys')}; + + my @param_list = ( + {name => 'useclassification', type => 'b', default => 0}, + + {name => 'usetargetmilestone', type => 'b', default => 0}, + + {name => 'useqacontact', type => 'b', default => 0}, + + {name => 'usestatuswhiteboard', type => 'b', default => 0}, + + {name => 'usebugaliases', type => 'b', default => 0}, + + {name => 'use_see_also', type => 'b', default => 1}, + + { + name => 'defaultpriority', + type => 's', + choices => \@legal_priorities, + default => $legal_priorities[-1], + checker => \&check_priority + }, + + { + name => 'defaultseverity', + type => 's', + choices => \@legal_severities, + default => $legal_severities[-1], + checker => \&check_severity + }, + + { + name => 'defaultplatform', + type => 's', + choices => ['', @legal_platforms], + default => '', + checker => \&check_platform + }, + + { + name => 'defaultopsys', + type => 's', + choices => ['', @legal_OS], + default => '', + checker => \&check_opsys + }, + + {name => 'collapsed_comment_tags', type => 't', default => 'obsolete, spam',} + ); + return @param_list; } 1; diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm index 24b636099..b3d0cb5f8 100644 --- a/Bugzilla/Config/Common.pm +++ b/Bugzilla/Config/Common.pm @@ -22,311 +22,318 @@ use Bugzilla::Status; use base qw(Exporter); @Bugzilla::Config::Common::EXPORT = qw( - check_multi check_numeric check_regexp check_url check_group - check_priority check_severity check_platform - check_opsys check_shadowdb check_urlbase check_webdotbase - check_user_verify_class - check_mail_delivery_method check_notification check_utf8 - check_bug_status check_smtp_auth check_theschwartz_available - check_maxattachmentsize check_email - check_comment_taggers_group - get_all_group_names + check_multi check_numeric check_regexp check_url check_group + check_priority check_severity check_platform + check_opsys check_shadowdb check_urlbase check_webdotbase + check_user_verify_class + check_mail_delivery_method check_notification check_utf8 + check_bug_status check_smtp_auth check_theschwartz_available + check_maxattachmentsize check_email + check_comment_taggers_group + get_all_group_names ); # Checking functions for the various values sub check_multi { - my ( $value, $param ) = (@_); + my ($value, $param) = (@_); - if ( $param->{'type'} eq "s" ) { - unless ( scalar( grep { $_ eq $value } ( @{ $param->{'choices'} } ) ) ) { - return "Invalid choice '$value' for single-select list param '$param->{'name'}'"; - } - - return ""; - } - elsif ( $param->{'type'} eq 'm' || $param->{'type'} eq 'o' ) { - foreach my $chkParam ( split( ',', $value ) ) { - unless ( scalar( grep { $_ eq $chkParam } ( @{ $param->{'choices'} } ) ) ) { - return "Invalid choice '$chkParam' for multi-select list param '$param->{'name'}'"; - } - } - - return ""; + if ($param->{'type'} eq "s") { + unless (scalar(grep { $_ eq $value } (@{$param->{'choices'}}))) { + return + "Invalid choice '$value' for single-select list param '$param->{'name'}'"; } - else { - return "Invalid param type '$param->{'type'}' for check_multi(); " . "contact your Bugzilla administrator"; + + return ""; + } + elsif ($param->{'type'} eq 'm' || $param->{'type'} eq 'o') { + foreach my $chkParam (split(',', $value)) { + unless (scalar(grep { $_ eq $chkParam } (@{$param->{'choices'}}))) { + return + "Invalid choice '$chkParam' for multi-select list param '$param->{'name'}'"; + } } + + return ""; + } + else { + return "Invalid param type '$param->{'type'}' for check_multi(); " + . "contact your Bugzilla administrator"; + } } sub check_numeric { - my ($value) = (@_); - if ( $value !~ /^[0-9]+$/ ) { - return "must be a numeric value"; - } - return ""; + my ($value) = (@_); + if ($value !~ /^[0-9]+$/) { + return "must be a numeric value"; + } + return ""; } sub check_regexp { - my ($value) = (@_); - eval {qr/$value/}; - return $@; + my ($value) = (@_); + eval {qr/$value/}; + return $@; } sub check_email { - my ($value) = @_; - if ( $value !~ $Email::Address::mailbox ) { - return "must be a valid email address."; - } - return ""; + my ($value) = @_; + if ($value !~ $Email::Address::mailbox) { + return "must be a valid email address."; + } + return ""; } sub check_utf8 { - my ($utf8, $entry) = @_; + my ($utf8, $entry) = @_; - # You cannot turn off the UTF-8 parameter. - if ( !$utf8 ) { - return "You cannot disable UTF-8 support."; - } - elsif ($entry eq 'utf8mb4' && $utf8 ne 'utf8mb4') { - return "You cannot disable UTF8-MB4 support."; - } + # You cannot turn off the UTF-8 parameter. + if (!$utf8) { + return "You cannot disable UTF-8 support."; + } + elsif ($entry eq 'utf8mb4' && $utf8 ne 'utf8mb4') { + return "You cannot disable UTF8-MB4 support."; + } - return ""; + return ""; } sub check_priority { - my ($value) = (@_); - my $legal_priorities = get_legal_field_values('priority'); - if ( !grep( $_ eq $value, @$legal_priorities ) ) { - return "Must be a legal priority value: one of " . join( ", ", @$legal_priorities ); - } - return ""; + my ($value) = (@_); + my $legal_priorities = get_legal_field_values('priority'); + if (!grep($_ eq $value, @$legal_priorities)) { + return "Must be a legal priority value: one of " + . join(", ", @$legal_priorities); + } + return ""; } sub check_severity { - my ($value) = (@_); - my $legal_severities = get_legal_field_values('bug_severity'); - if ( !grep( $_ eq $value, @$legal_severities ) ) { - return "Must be a legal severity value: one of " . join( ", ", @$legal_severities ); - } - return ""; + my ($value) = (@_); + my $legal_severities = get_legal_field_values('bug_severity'); + if (!grep($_ eq $value, @$legal_severities)) { + return "Must be a legal severity value: one of " + . join(", ", @$legal_severities); + } + return ""; } sub check_platform { - my ($value) = (@_); - my $legal_platforms = get_legal_field_values('rep_platform'); - if ( !grep( $_ eq $value, '', @$legal_platforms ) ) { - return "Must be empty or a legal platform value: one of " . join( ", ", @$legal_platforms ); - } - return ""; + my ($value) = (@_); + my $legal_platforms = get_legal_field_values('rep_platform'); + if (!grep($_ eq $value, '', @$legal_platforms)) { + return "Must be empty or a legal platform value: one of " + . join(", ", @$legal_platforms); + } + return ""; } sub check_opsys { - my ($value) = (@_); - my $legal_OS = get_legal_field_values('op_sys'); - if ( !grep( $_ eq $value, '', @$legal_OS ) ) { - return "Must be empty or a legal operating system value: one of " . join( ", ", @$legal_OS ); - } - return ""; + my ($value) = (@_); + my $legal_OS = get_legal_field_values('op_sys'); + if (!grep($_ eq $value, '', @$legal_OS)) { + return "Must be empty or a legal operating system value: one of " + . join(", ", @$legal_OS); + } + return ""; } sub check_bug_status { - my $bug_status = shift; - my @closed_bug_statuses = map { $_->name } closed_bug_statuses(); - if ( !grep( $_ eq $bug_status, @closed_bug_statuses ) ) { - return "Must be a valid closed status: one of " . join( ', ', @closed_bug_statuses ); - } - return ""; + my $bug_status = shift; + my @closed_bug_statuses = map { $_->name } closed_bug_statuses(); + if (!grep($_ eq $bug_status, @closed_bug_statuses)) { + return "Must be a valid closed status: one of " + . join(', ', @closed_bug_statuses); + } + return ""; } sub check_group { - my $group_name = shift; - return "" unless $group_name; - my $group = new Bugzilla::Group( { 'name' => $group_name } ); - unless ( defined $group ) { - return "Must be an existing group name"; - } - return ""; + my $group_name = shift; + return "" unless $group_name; + my $group = new Bugzilla::Group({'name' => $group_name}); + unless (defined $group) { + return "Must be an existing group name"; + } + return ""; } sub check_shadowdb { - my ($value) = (@_); - $value = trim($value); - if ( $value eq "" ) { - return ""; - } + my ($value) = (@_); + $value = trim($value); + if ($value eq "") { + return ""; + } - if ( !Bugzilla->params->{'shadowdbhost'} ) { - return "You need to specify a host when using a shadow database"; - } + if (!Bugzilla->params->{'shadowdbhost'}) { + return "You need to specify a host when using a shadow database"; + } - # Can't test existence of this because ConnectToDatabase uses the param, - # but we can't set this before testing.... - # This can really only be fixed after we can use the DBI more openly - return ""; + # Can't test existence of this because ConnectToDatabase uses the param, + # but we can't set this before testing.... + # This can really only be fixed after we can use the DBI more openly + return ""; } sub check_urlbase { - my ($url) = (@_); - if ( $url && $url !~ m:^http.*/$: ) { - return "must be a legal URL, that starts with http and ends with a slash."; - } - return ""; + my ($url) = (@_); + if ($url && $url !~ m:^http.*/$:) { + return "must be a legal URL, that starts with http and ends with a slash."; + } + return ""; } sub check_url { - my ($url) = (@_); - return '' if $url eq ''; # Allow empty URLs - if ( $url !~ m:/$: ) { - return 'must be a legal URL, absolute or relative, ending with a slash.'; - } - return ''; + my ($url) = (@_); + return '' if $url eq ''; # Allow empty URLs + if ($url !~ m:/$:) { + return 'must be a legal URL, absolute or relative, ending with a slash.'; + } + return ''; } sub check_webdotbase { - my ($value) = (@_); - $value = trim($value); - if ( $value eq "" ) { - return ""; + my ($value) = (@_); + $value = trim($value); + if ($value eq "") { + return ""; + } + if ($value !~ /^https?:/) { + if (!-x $value) { + return + "The file path \"$value\" is not a valid executable. Please specify the complete file path to 'dot' if you intend to generate graphs locally."; } - if ( $value !~ /^https?:/ ) { - if ( !-x $value ) { - return - "The file path \"$value\" is not a valid executable. Please specify the complete file path to 'dot' if you intend to generate graphs locally."; - } - - # Check .htaccess allows access to generated images - my $webdotdir = bz_locations()->{'webdotdir'}; - if ( -e "$webdotdir/.htaccess" ) { - open HTACCESS, "<", "$webdotdir/.htaccess"; - if ( !grep( / \\\.png\$/, <HTACCESS> ) ) { - return - "Dependency graph images are not accessible.\nAssuming that you have not modified the file, delete $webdotdir/.htaccess and re-run checksetup.pl to rectify.\n"; - } - close HTACCESS; - } + + # Check .htaccess allows access to generated images + my $webdotdir = bz_locations()->{'webdotdir'}; + if (-e "$webdotdir/.htaccess") { + open HTACCESS, "<", "$webdotdir/.htaccess"; + if (!grep(/ \\\.png\$/, <HTACCESS>)) { + return + "Dependency graph images are not accessible.\nAssuming that you have not modified the file, delete $webdotdir/.htaccess and re-run checksetup.pl to rectify.\n"; + } + close HTACCESS; } - return ""; + } + return ""; } sub check_user_verify_class { - # doeditparams traverses the list of params, and for each one it checks, - # then updates. This means that if one param checker wants to look at - # other params, it must be below that other one. So you can't have two - # params mutually dependent on each other. - # This means that if someone clears the LDAP config params after setting - # the login method as LDAP, we won't notice, but all logins will fail. - # So don't do that. - - my $params = Bugzilla->params; - my ( $list, $entry ) = @_; - $list || return 'You need to specify at least one authentication mechanism'; - for my $class ( split /,\s*/, $list ) { - my $res = check_multi( $class, $entry ); - return $res if $res; - if ( $class eq 'RADIUS' ) { - if ( !Bugzilla->feature('auth_radius') ) { - return "RADIUS support is not available. Run checksetup.pl" . " for more details"; - } - return "RADIUS servername (RADIUS_server) is missing" - if !$params->{"RADIUS_server"}; - return "RADIUS_secret is empty" if !$params->{"RADIUS_secret"}; - } - elsif ( $class eq 'LDAP' ) { - if ( !Bugzilla->feature('auth_ldap') ) { - return "LDAP support is not available. Run checksetup.pl" . " for more details"; - } - return "LDAP servername (LDAPserver) is missing" - if !$params->{"LDAPserver"}; - return "LDAPBaseDN is empty" if !$params->{"LDAPBaseDN"}; - } + # doeditparams traverses the list of params, and for each one it checks, + # then updates. This means that if one param checker wants to look at + # other params, it must be below that other one. So you can't have two + # params mutually dependent on each other. + # This means that if someone clears the LDAP config params after setting + # the login method as LDAP, we won't notice, but all logins will fail. + # So don't do that. + + my $params = Bugzilla->params; + my ($list, $entry) = @_; + $list || return 'You need to specify at least one authentication mechanism'; + for my $class (split /,\s*/, $list) { + my $res = check_multi($class, $entry); + return $res if $res; + if ($class eq 'RADIUS') { + if (!Bugzilla->feature('auth_radius')) { + return "RADIUS support is not available. Run checksetup.pl" + . " for more details"; + } + return "RADIUS servername (RADIUS_server) is missing" + if !$params->{"RADIUS_server"}; + return "RADIUS_secret is empty" if !$params->{"RADIUS_secret"}; } - return ""; + elsif ($class eq 'LDAP') { + if (!Bugzilla->feature('auth_ldap')) { + return "LDAP support is not available. Run checksetup.pl" . " for more details"; + } + return "LDAP servername (LDAPserver) is missing" if !$params->{"LDAPserver"}; + return "LDAPBaseDN is empty" if !$params->{"LDAPBaseDN"}; + } + } + return ""; } sub check_mail_delivery_method { - my $check = check_multi(@_); - return $check if $check; - my $mailer = shift; - if ( $mailer eq 'sendmail' and ON_WINDOWS ) { - - # look for sendmail.exe - return "Failed to locate " . SENDMAIL_EXE - unless -e SENDMAIL_EXE; - } - return ""; + my $check = check_multi(@_); + return $check if $check; + my $mailer = shift; + if ($mailer eq 'sendmail' and ON_WINDOWS) { + + # look for sendmail.exe + return "Failed to locate " . SENDMAIL_EXE unless -e SENDMAIL_EXE; + } + return ""; } sub check_maxattachmentsize { - my $check = check_numeric(@_); - return $check if $check; - my $size = shift; - my $dbh = Bugzilla->dbh; - if ( $dbh->isa('Bugzilla::DB::Mysql') ) { - my ( undef, $max_packet ) = $dbh->selectrow_array(q{SHOW VARIABLES LIKE 'max\_allowed\_packet'}); - my $byte_size = $size * 1024; - if ( $max_packet < $byte_size ) { - return - "You asked for a maxattachmentsize of $byte_size bytes," - . " but the max_allowed_packet setting in MySQL currently" - . " only allows packets up to $max_packet bytes"; - } + my $check = check_numeric(@_); + return $check if $check; + my $size = shift; + my $dbh = Bugzilla->dbh; + if ($dbh->isa('Bugzilla::DB::Mysql')) { + my (undef, $max_packet) + = $dbh->selectrow_array(q{SHOW VARIABLES LIKE 'max\_allowed\_packet'}); + my $byte_size = $size * 1024; + if ($max_packet < $byte_size) { + return + "You asked for a maxattachmentsize of $byte_size bytes," + . " but the max_allowed_packet setting in MySQL currently" + . " only allows packets up to $max_packet bytes"; } - return ""; + } + return ""; } sub check_notification { - my $option = shift; - my @current_version = ( BUGZILLA_VERSION =~ m/^(\d+)\.(\d+)(?:(rc|\.)(\d+))?\+?$/ ); - if ( $current_version[1] % 2 && $option eq 'stable_branch_release' ) { - return - "You are currently running a development snapshot, and so your " - . "installation is not based on a branch. If you want to be notified " - . "about the next stable release, you should select " - . "'latest_stable_release' instead"; - } - if ( $option ne 'disabled' && !Bugzilla->feature('updates') ) { - return "Some Perl modules are missing to get notifications about " - . "new releases. See the output of checksetup.pl for more information"; - } - return ""; + my $option = shift; + my @current_version + = (BUGZILLA_VERSION =~ m/^(\d+)\.(\d+)(?:(rc|\.)(\d+))?\+?$/); + if ($current_version[1] % 2 && $option eq 'stable_branch_release') { + return + "You are currently running a development snapshot, and so your " + . "installation is not based on a branch. If you want to be notified " + . "about the next stable release, you should select " + . "'latest_stable_release' instead"; + } + if ($option ne 'disabled' && !Bugzilla->feature('updates')) { + return "Some Perl modules are missing to get notifications about " + . "new releases. See the output of checksetup.pl for more information"; + } + return ""; } sub check_smtp_auth { - my $username = shift; - if ( $username and !Bugzilla->feature('smtp_auth') ) { - return "SMTP Authentication is not available. Run checksetup.pl for" . " more details"; - } - return ""; + my $username = shift; + if ($username and !Bugzilla->feature('smtp_auth')) { + return "SMTP Authentication is not available. Run checksetup.pl for" + . " more details"; + } + return ""; } sub check_theschwartz_available { - my $use_queue = shift; - if ( $use_queue && !Bugzilla->feature('jobqueue') ) { - return - "Using the job queue requires that you have certain Perl" - . " modules installed. See the output of checksetup.pl" - . " for more information"; - } - return ""; + my $use_queue = shift; + if ($use_queue && !Bugzilla->feature('jobqueue')) { + return + "Using the job queue requires that you have certain Perl" + . " modules installed. See the output of checksetup.pl" + . " for more information"; + } + return ""; } sub check_comment_taggers_group { - my $group_name = shift; - if ( $group_name && !Bugzilla->feature('jsonrpc') ) { - return "Comment tagging requires installation of the JSONRPC feature"; - } - return check_group($group_name); + my $group_name = shift; + if ($group_name && !Bugzilla->feature('jsonrpc')) { + return "Comment tagging requires installation of the JSONRPC feature"; + } + return check_group($group_name); } sub get_all_group_names { - return [ - '', - map { $_->name } Bugzilla::Group->get_all, - ]; + return ['', map { $_->name } Bugzilla::Group->get_all,]; } # OK, here are the parameter definitions themselves. @@ -393,7 +400,7 @@ sub get_all_group_names { # for list (single and multiple) parameter types. sub get_param_list { - return; + return; } 1; diff --git a/Bugzilla/Config/DependencyGraph.pm b/Bugzilla/Config/DependencyGraph.pm index 965be803a..2b48d634c 100644 --- a/Bugzilla/Config/DependencyGraph.pm +++ b/Bugzilla/Config/DependencyGraph.pm @@ -40,16 +40,14 @@ use Bugzilla::Config::Common; our $sortkey = 800; sub get_param_list { - my $class = shift; - my @param_list = ( - { - name => 'webdotbase', - type => 't', - default => 'http://www.research.att.com/~north/cgi-bin/webdot.cgi/%urlbase%', - checker => \&check_webdotbase - } - ); - return @param_list; + my $class = shift; + my @param_list = ({ + name => 'webdotbase', + type => 't', + default => 'http://www.research.att.com/~north/cgi-bin/webdot.cgi/%urlbase%', + checker => \&check_webdotbase + }); + return @param_list; } 1; diff --git a/Bugzilla/Config/Elastic.pm b/Bugzilla/Config/Elastic.pm index 690f5fac5..d0ca7a02a 100644 --- a/Bugzilla/Config/Elastic.pm +++ b/Bugzilla/Config/Elastic.pm @@ -16,23 +16,11 @@ use Bugzilla::Config::Common; our $sortkey = 1550; sub get_param_list { - return ( - { - name => 'elasticsearch', - type => 'b', - default => 0, - }, - { - name => 'elasticsearch_nodes', - type => 't', - default => 'localhost:9200', - }, - { - name => 'elasticsearch_index', - type => 't', - default => 'bugzilla', - }, - ); + return ( + {name => 'elasticsearch', type => 'b', default => 0,}, + {name => 'elasticsearch_nodes', type => 't', default => 'localhost:9200',}, + {name => 'elasticsearch_index', type => 't', default => 'bugzilla',}, + ); } 1; diff --git a/Bugzilla/Config/General.pm b/Bugzilla/Config/General.pm index fa7cf2d08..bf4088248 100644 --- a/Bugzilla/Config/General.pm +++ b/Bugzilla/Config/General.pm @@ -16,50 +16,49 @@ use Bugzilla::Config::Common; our $sortkey = 150; use constant get_param_list => ( - { - name => 'maintainer', - type => 't', - no_reset => '1', - default => '', - checker => \&check_email - }, + { + name => 'maintainer', + type => 't', + no_reset => '1', + default => '', + checker => \&check_email + }, - { - name => 'nobody_user', - type => 't', - no_reset => '1', - default => 'nobody@mozilla.org', - checker => \&check_email - }, + { + name => 'nobody_user', + type => 't', + no_reset => '1', + default => 'nobody@mozilla.org', + checker => \&check_email + }, - { - name => 'docs_urlbase', - type => 't', - default => 'docs/%lang%/html/', - checker => \&check_url - }, + { + name => 'docs_urlbase', + type => 't', + default => 'docs/%lang%/html/', + checker => \&check_url + }, - { - name => 'utf8', - type => 's', - choices => [ '1', 'utf8', 'utf8mb4' ], - default => 'utf8', - checker => \&check_utf8 - }, + { + name => 'utf8', + type => 's', + choices => ['1', 'utf8', 'utf8mb4'], + default => 'utf8', + checker => \&check_utf8 + }, - { - name => 'announcehtml', - type => 'l', - default => '' - }, + {name => 'announcehtml', type => 'l', default => ''}, - { - name => 'upgrade_notification', - type => 's', - choices => [ 'development_snapshot', 'latest_stable_release', 'stable_branch_release', 'disabled' ], - default => 'latest_stable_release', - checker => \&check_notification - }, + { + name => 'upgrade_notification', + type => 's', + choices => [ + 'development_snapshot', 'latest_stable_release', + 'stable_branch_release', 'disabled' + ], + default => 'latest_stable_release', + checker => \&check_notification + }, ); 1; diff --git a/Bugzilla/Config/GroupSecurity.pm b/Bugzilla/Config/GroupSecurity.pm index 68c852fe6..f6f824098 100644 --- a/Bugzilla/Config/GroupSecurity.pm +++ b/Bugzilla/Config/GroupSecurity.pm @@ -17,78 +17,65 @@ use Bugzilla::Group; our $sortkey = 900; sub get_param_list { - my $class = shift; - - my @param_list = ( - { - name => 'makeproductgroups', - type => 'b', - default => 0 - }, - - { - name => 'chartgroup', - type => 's', - choices => \&get_all_group_names, - default => 'editbugs', - checker => \&check_group - }, - - { - name => 'insidergroup', - type => 's', - choices => \&get_all_group_names, - default => '', - checker => \&check_group - }, - - { - name => 'timetrackinggroup', - type => 's', - choices => \&get_all_group_names, - default => 'editbugs', - checker => \&check_group - }, - - { - name => 'querysharegroup', - type => 's', - choices => \&get_all_group_names, - default => 'editbugs', - checker => \&check_group - }, - - { - name => 'comment_taggers_group', - type => 's', - choices => \&get_all_group_names, - default => 'editbugs', - checker => \&check_comment_taggers_group - }, - - { - name => 'debug_group', - type => 's', - choices => \&get_all_group_names, - default => 'admin', - checker => \&check_group - }, - - { - name => 'usevisibilitygroups', - type => 'b', - default => 0 - }, - - { - name => 'strict_isolation', - type => 'b', - default => 0 - } - ); - return @param_list; + my $class = shift; + + my @param_list = ( + {name => 'makeproductgroups', type => 'b', default => 0}, + + { + name => 'chartgroup', + type => 's', + choices => \&get_all_group_names, + default => 'editbugs', + checker => \&check_group + }, + + { + name => 'insidergroup', + type => 's', + choices => \&get_all_group_names, + default => '', + checker => \&check_group + }, + + { + name => 'timetrackinggroup', + type => 's', + choices => \&get_all_group_names, + default => 'editbugs', + checker => \&check_group + }, + + { + name => 'querysharegroup', + type => 's', + choices => \&get_all_group_names, + default => 'editbugs', + checker => \&check_group + }, + + { + name => 'comment_taggers_group', + type => 's', + choices => \&get_all_group_names, + default => 'editbugs', + checker => \&check_comment_taggers_group + }, + + { + name => 'debug_group', + type => 's', + choices => \&get_all_group_names, + default => 'admin', + checker => \&check_group + }, + + {name => 'usevisibilitygroups', type => 'b', default => 0}, + + {name => 'strict_isolation', type => 'b', default => 0} + ); + return @param_list; } - 1; diff --git a/Bugzilla/Config/LDAP.pm b/Bugzilla/Config/LDAP.pm index a3ce04fbe..75f58e141 100644 --- a/Bugzilla/Config/LDAP.pm +++ b/Bugzilla/Config/LDAP.pm @@ -16,51 +16,23 @@ use Bugzilla::Config::Common; our $sortkey = 1000; sub get_param_list { - my $class = shift; - my @param_list = ( - { - name => 'LDAPserver', - type => 't', - default => '' - }, + my $class = shift; + my @param_list = ( + {name => 'LDAPserver', type => 't', default => ''}, - { - name => 'LDAPstarttls', - type => 'b', - default => 0 - }, + {name => 'LDAPstarttls', type => 'b', default => 0}, - { - name => 'LDAPbinddn', - type => 't', - default => '' - }, + {name => 'LDAPbinddn', type => 't', default => ''}, - { - name => 'LDAPBaseDN', - type => 't', - default => '' - }, + {name => 'LDAPBaseDN', type => 't', default => ''}, - { - name => 'LDAPuidattribute', - type => 't', - default => 'uid' - }, + {name => 'LDAPuidattribute', type => 't', default => 'uid'}, - { - name => 'LDAPmailattribute', - type => 't', - default => 'mail' - }, + {name => 'LDAPmailattribute', type => 't', default => 'mail'}, - { - name => 'LDAPfilter', - type => 't', - default => '', - } - ); - return @param_list; + {name => 'LDAPfilter', type => 't', default => '',} + ); + return @param_list; } 1; diff --git a/Bugzilla/Config/MTA.pm b/Bugzilla/Config/MTA.pm index c23c324d9..c57989ee4 100644 --- a/Bugzilla/Config/MTA.pm +++ b/Bugzilla/Config/MTA.pm @@ -41,78 +41,51 @@ use Bugzilla::Config::Common; # deprecated module. We have to set NO_CLUCK = 1 before loading Email::Send # to disable these warnings. BEGIN { - $Return::Value::NO_CLUCK = 1; + $Return::Value::NO_CLUCK = 1; } use Email::Send; our $sortkey = 1200; sub get_param_list { - my $class = shift; - my @param_list = ( - { - name => 'mail_delivery_method', - type => 's', + my $class = shift; + my @param_list = ( + { + name => 'mail_delivery_method', + type => 's', - # Bugzilla is not ready yet to send mails to newsgroups, and 'IO' - # is of no use for now as we already have our own 'Test' mode. - choices => [ grep { $_ ne 'NNTP' && $_ ne 'IO' } Email::Send->new()->all_mailers(), 'None' ], - default => 'Sendmail', - checker => \&check_mail_delivery_method - }, + # Bugzilla is not ready yet to send mails to newsgroups, and 'IO' + # is of no use for now as we already have our own 'Test' mode. + choices => [ + grep { $_ ne 'NNTP' && $_ ne 'IO' } Email::Send->new()->all_mailers(), 'None' + ], + default => 'Sendmail', + checker => \&check_mail_delivery_method + }, - { - name => 'mailfrom', - type => 't', - default => 'bugzilla-daemon' - }, + {name => 'mailfrom', type => 't', default => 'bugzilla-daemon'}, - { - name => 'use_mailer_queue', - type => 'b', - default => 0, - checker => \&check_theschwartz_available, - }, + { + name => 'use_mailer_queue', + type => 'b', + default => 0, + checker => \&check_theschwartz_available, + }, - { - name => 'smtpserver', - type => 't', - default => 'localhost' - }, - { - name => 'smtp_username', - type => 't', - default => '', - checker => \&check_smtp_auth - }, - { - name => 'smtp_password', - type => 'p', - default => '' - }, - { - name => 'smtp_debug', - type => 'b', - default => 0 - }, - { - name => 'whinedays', - type => 't', - default => 7, - checker => \&check_numeric - }, - { - name => 'globalwatchers', - type => 't', - default => '', - }, - { - name => 'silent_users', - type => 't', - default => '', - }, - ); - return @param_list; + {name => 'smtpserver', type => 't', default => 'localhost'}, + { + name => 'smtp_username', + type => 't', + default => '', + checker => \&check_smtp_auth + }, + {name => 'smtp_password', type => 'p', default => ''}, + {name => 'smtp_debug', type => 'b', default => 0}, + {name => 'whinedays', type => 't', default => 7, checker => \&check_numeric}, + {name => 'globalwatchers', type => 't', default => '',}, + {name => 'silent_users', type => 't', default => '',}, + ); + return @param_list; } 1; diff --git a/Bugzilla/Config/PatchViewer.pm b/Bugzilla/Config/PatchViewer.pm index 98c8c675f..e735aac63 100644 --- a/Bugzilla/Config/PatchViewer.pm +++ b/Bugzilla/Config/PatchViewer.pm @@ -40,39 +40,19 @@ use Bugzilla::Config::Common; our $sortkey = 1300; sub get_param_list { - my $class = shift; - my @param_list = ( - { - name => 'cvsroot', - type => 't', - default => '', - }, + my $class = shift; + my @param_list = ( + {name => 'cvsroot', type => 't', default => '',}, - { - name => 'cvsroot_get', - type => 't', - default => '', - }, + {name => 'cvsroot_get', type => 't', default => '',}, - { - name => 'bonsai_url', - type => 't', - default => '' - }, + {name => 'bonsai_url', type => 't', default => ''}, - { - name => 'lxr_url', - type => 't', - default => '' - }, + {name => 'lxr_url', type => 't', default => ''}, - { - name => 'lxr_root', - type => 't', - default => '', - } - ); - return @param_list; + {name => 'lxr_root', type => 't', default => '',} + ); + return @param_list; } 1; diff --git a/Bugzilla/Config/Query.pm b/Bugzilla/Config/Query.pm index b6397a835..83115717a 100644 --- a/Bugzilla/Config/Query.pm +++ b/Bugzilla/Config/Query.pm @@ -16,58 +16,54 @@ use Bugzilla::Config::Common; our $sortkey = 1400; sub get_param_list { - my $class = shift; - my @param_list = ( - { - name => 'quip_list_entry_control', - type => 's', - choices => [ 'open', 'moderated', 'closed' ], - default => 'open', - checker => \&check_multi - }, + my $class = shift; + my @param_list = ( + { + name => 'quip_list_entry_control', + type => 's', + choices => ['open', 'moderated', 'closed'], + default => 'open', + checker => \&check_multi + }, - { - name => 'mostfreqthreshold', - type => 't', - default => '2', - checker => \&check_numeric - }, + { + name => 'mostfreqthreshold', + type => 't', + default => '2', + checker => \&check_numeric + }, - { - name => 'mybugstemplate', - type => 't', - default => - 'buglist.cgi?resolution=---&emailassigned_to1=1&emailreporter1=1&emailtype1=exact&email1=%userid%' - }, + { + name => 'mybugstemplate', + type => 't', + default => + 'buglist.cgi?resolution=---&emailassigned_to1=1&emailreporter1=1&emailtype1=exact&email1=%userid%' + }, - { - name => 'defaultquery', - type => 't', - default => - 'resolution=---&emailassigned_to1=1&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailqa_contact2=1&emaillongdesc3=1&order=Importance&long_desc_type=substring' - }, + { + name => 'defaultquery', + type => 't', + default => + 'resolution=---&emailassigned_to1=1&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailqa_contact2=1&emaillongdesc3=1&order=Importance&long_desc_type=substring' + }, - { - name => 'search_allow_no_criteria', - type => 'b', - default => 1 - }, + {name => 'search_allow_no_criteria', type => 'b', default => 1}, - { - name => 'default_search_limit', - type => 't', - default => '500', - checker => \&check_numeric - }, + { + name => 'default_search_limit', + type => 't', + default => '500', + checker => \&check_numeric + }, - { - name => 'max_search_results', - type => 't', - default => '10000', - checker => \&check_numeric - }, - ); - return @param_list; + { + name => 'max_search_results', + type => 't', + default => '10000', + checker => \&check_numeric + }, + ); + return @param_list; } 1; diff --git a/Bugzilla/Config/RADIUS.pm b/Bugzilla/Config/RADIUS.pm index bc980a1ec..b0a5ddbf5 100644 --- a/Bugzilla/Config/RADIUS.pm +++ b/Bugzilla/Config/RADIUS.pm @@ -16,33 +16,17 @@ use Bugzilla::Config::Common; our $sortkey = 1100; sub get_param_list { - my $class = shift; - my @param_list = ( - { - name => 'RADIUS_server', - type => 't', - default => '' - }, - - { - name => 'RADIUS_secret', - type => 't', - default => '' - }, - - { - name => 'RADIUS_NAS_IP', - type => 't', - default => '' - }, - - { - name => 'RADIUS_email_suffix', - type => 't', - default => '' - }, - ); - return @param_list; + my $class = shift; + my @param_list = ( + {name => 'RADIUS_server', type => 't', default => ''}, + + {name => 'RADIUS_secret', type => 't', default => ''}, + + {name => 'RADIUS_NAS_IP', type => 't', default => ''}, + + {name => 'RADIUS_email_suffix', type => 't', default => ''}, + ); + return @param_list; } 1; diff --git a/Bugzilla/Config/Reports.pm b/Bugzilla/Config/Reports.pm index 26c5aad57..dfb6db7a3 100644 --- a/Bugzilla/Config/Reports.pm +++ b/Bugzilla/Config/Reports.pm @@ -16,22 +16,14 @@ use Bugzilla::Config::Common; our $sortkey = 1100; sub get_param_list { - my $class = shift; - my @param_list = ( - { - name => 'report_secbugs_active', - type => 'b', - default => 1, - }, - { - name => 'report_secbugs_emails', - type => 't', - default => 'bugzilla-admin@mozilla.org' - }, - { - name => 'report_secbugs_products', - type => 'l', - default => '[]' - }, - ); + my $class = shift; + my @param_list = ( + {name => 'report_secbugs_active', type => 'b', default => 1,}, + { + name => 'report_secbugs_emails', + type => 't', + default => 'bugzilla-admin@mozilla.org' + }, + {name => 'report_secbugs_products', type => 'l', default => '[]'}, + ); } diff --git a/Bugzilla/Config/ShadowDB.pm b/Bugzilla/Config/ShadowDB.pm index 772df5675..101e4678f 100644 --- a/Bugzilla/Config/ShadowDB.pm +++ b/Bugzilla/Config/ShadowDB.pm @@ -16,37 +16,24 @@ use Bugzilla::Config::Common; our $sortkey = 1500; sub get_param_list { - my $class = shift; - my @param_list = ( - { - name => 'shadowdbhost', - type => 't', - default => '', - }, - - { - name => 'shadowdbport', - type => 't', - default => '3306', - checker => \&check_numeric, - }, - - { - name => 'shadowdbsock', - type => 't', - default => '', - }, - - # This entry must be _after_ the shadowdb{host,port,sock} settings so that - # they can be used in the validation here - { - name => 'shadowdb', - type => 't', - default => '', - checker => \&check_shadowdb - } - ); - return @param_list; + my $class = shift; + my @param_list = ( + {name => 'shadowdbhost', type => 't', default => '',}, + + { + name => 'shadowdbport', + type => 't', + default => '3306', + checker => \&check_numeric, + }, + + {name => 'shadowdbsock', type => 't', default => '',}, + + # This entry must be _after_ the shadowdb{host,port,sock} settings so that + # they can be used in the validation here + {name => 'shadowdb', type => 't', default => '', checker => \&check_shadowdb} + ); + return @param_list; } 1; diff --git a/Bugzilla/Config/UserMatch.pm b/Bugzilla/Config/UserMatch.pm index ddb850f3b..a1f8a3eb2 100644 --- a/Bugzilla/Config/UserMatch.pm +++ b/Bugzilla/Config/UserMatch.pm @@ -16,34 +16,22 @@ use Bugzilla::Config::Common; our $sortkey = 1600; sub get_param_list { - my $class = shift; - my @param_list = ( - { - name => 'usemenuforusers', - type => 'b', - default => '0' - }, - - { - name => 'ajax_user_autocompletion', - type => 'b', - default => '1', - }, - - { - name => 'maxusermatches', - type => 't', - default => '1000', - checker => \&check_numeric - }, - - { - name => 'confirmuniqueusermatch', - type => 'b', - default => 1, - } - ); - return @param_list; + my $class = shift; + my @param_list = ( + {name => 'usemenuforusers', type => 'b', default => '0'}, + + {name => 'ajax_user_autocompletion', type => 'b', default => '1',}, + + { + name => 'maxusermatches', + type => 't', + default => '1000', + checker => \&check_numeric + }, + + {name => 'confirmuniqueusermatch', type => 'b', default => 1,} + ); + return @param_list; } 1; |