summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Config/Attachment.pm
diff options
context:
space:
mode:
authorPerl Tidy <perltidy@bugzilla.org>2018-12-05 21:38:52 +0100
committerDylan William Hardison <dylan@hardison.net>2018-12-05 23:49:08 +0100
commit8ec8da0491ad89604700b3e29a227966f6d84ba1 (patch)
tree9d270f173330ca19700e0ba9f2ee931300646de1 /Bugzilla/Config/Attachment.pm
parenta7bb5a65b71644d9efce5fed783ed545b9336548 (diff)
downloadbugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.gz
bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.xz
no bug - reformat all the code using the new perltidy rules
Diffstat (limited to 'Bugzilla/Config/Attachment.pm')
-rw-r--r--Bugzilla/Config/Attachment.pm106
1 files changed, 43 insertions, 63 deletions
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;