Commit 78709910 authored by sikeda's avatar sikeda
Browse files

[dev] Perltidy'ing using perltidy-20121207.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@12913 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 3949397a
......@@ -101,8 +101,7 @@ if ($robot) {
} else {
$home_sympa = $Conf::Conf{'home'};
}
my $dest_dir =
Conf::get_robot_conf($robot, 'arc_path') . '/' . $list->get_id;
my $dest_dir = Conf::get_robot_conf($robot, 'arc_path') . '/' . $list->get_id;
unless (-d "$home_sympa/$listname") {
die "No directory for list $listname";
......
......@@ -41,8 +41,8 @@ while (1) {
my $context = $message->{context};
next
unless ref $context eq 'Sympa::List'
and $message->{authkey}
and $message->{authkey} =~ /\A\w+\z/;
and $message->{authkey}
and $message->{authkey} =~ /\A\w+\z/;
next
if -f join('/',
$spool_mod->{html_base_directory}, $context->get_id,
......
......@@ -130,7 +130,8 @@ sub sympa_checksum {
my $rcpt = shift;
return (
substr(
Digest::MD5::md5_hex(join('/', $Conf::Conf{'cookie'}, $rcpt)), -10
Digest::MD5::md5_hex(join('/', $Conf::Conf{'cookie'}, $rcpt)),
-10
)
);
}
......
......@@ -55,7 +55,7 @@ while (my $user = $sth->fetchrow_hashref('NAME_lc')) {
# Ignore empty passwords
next
unless defined $user->{'password_user'}
and length $user->{'password_user'};
and length $user->{'password_user'};
if ($user->{'password_user'} =~ /^[0-9a-f]{32}/) {
printf "Password from %s already encoded as md5 fingerprint\n",
......
This diff is collapsed.
......@@ -589,7 +589,7 @@ sub conf_2_db {
my $config;
if (my $result_of_config_loading = _load_config_file_to_hash(
{ 'path_to_config_file' => $Conf{'etc'} . '/'
{ 'path_to_config_file' => $Conf{'etc'} . '/'
. $robot
. '/robot.conf'
}
......@@ -1204,8 +1204,8 @@ sub _load_auth {
}
$Conf{'cas_id'}{$robot}
{$current_paragraph->{'auth_service_name'}}
{'casnum'} = scalar @paragraphs;
{$current_paragraph->{'auth_service_name'}}{'casnum'}
= scalar @paragraphs;
## Default value for auth_service_friendly_name IS
## auth_service_name
......@@ -1433,7 +1433,7 @@ sub load_automatic_lists_description {
my $config;
if (defined $robot) {
$config =
$Conf{'etc'} . '/'
$Conf{'etc'} . '/'
. $robot
. '/families/'
. $family
......@@ -1464,8 +1464,8 @@ sub load_automatic_lists_description {
$instance_param =~ /^\s*(\S+)\s+(.*)\s*$/;
my $key = $1;
my $value = $2;
$key =~ s/^\s*//;
$key =~ s/\s*$//;
$key =~ s/^\s*//;
$key =~ s/\s*$//;
$value =~ s/^\s*//;
$value =~ s/\s*$//;
$structured_instance->{$key} = $value;
......@@ -2536,9 +2536,9 @@ sub _source_has_not_changed {
my $file_bin = $file . $binary_file_extension;
return 1
if -r $file
and -r $file_bin
and Sympa::Tools::File::get_mtime($file) <
Sympa::Tools::File::get_mtime($file_bin);
and -r $file_bin
and Sympa::Tools::File::get_mtime($file) <
Sympa::Tools::File::get_mtime($file_bin);
return 0;
}
......
......@@ -468,9 +468,9 @@ sub send_notify_to_listmaster {
# Skip DB access because DB is not accessible
$email = [$email]
if not ref $email
and ( $operation eq 'missing_dbd'
or $operation eq 'no_db'
or $operation eq 'db_restored');
and ($operation eq 'missing_dbd'
or $operation eq 'no_db'
or $operation eq 'db_restored');
my $spindle = Sympa::Spindle::ProcessTemplate->new(
context => $that,
......
......@@ -1428,7 +1428,7 @@ sub install_aliases {
return 1
if Conf::get_robot_conf($list->{'domain'}, 'sendmail_aliases') =~
/^none$/i;
/^none$/i;
my $alias_manager = $Conf::Conf{'alias_manager'};
$log->syslog('debug2', '%s add %s %s', $alias_manager, $list->{'name'},
......@@ -1507,7 +1507,7 @@ sub remove_aliases {
return 1
if Conf::get_robot_conf($list->{'domain'}, 'sendmail_aliases') =~
/^none$/i;
/^none$/i;
my $status = $list->remove_aliases();
my $suffix =
......@@ -1668,7 +1668,7 @@ sub change_user_email {
my ($admin_user) = @{
$list->get_admins($role,
filter => [email => $in{'current_email'}])
};
};
if ($admin_user and $admin_user->{'included'}) {
# Notify listmaster
Sympa::send_notify_to_listmaster(
......
......@@ -80,8 +80,8 @@ sub store {
$operation, join(', ', @rcpts), $robot_id)
unless $operation eq 'logs_failed';
foreach my $rcpt (@rcpts) {
push @{$self->{_stack}
->{$robot_id}{$operation}{'messages'}{$rcpt}},
push @{$self->{_stack}->{$robot_id}{$operation}{'messages'}{$rcpt}
},
$message->as_string;
}
return 1;
......@@ -113,8 +113,8 @@ sub flush {
# not old enough to send and first not too old
next
unless $purge
or $last_age > 30
or $first_age > 60;
or $last_age > 30
or $first_age > 60;
next
unless $self->{_stack}->{$robot_id}{$operation}{'messages'};
......@@ -141,8 +141,8 @@ sub flush {
# Skip DB access because DB is not accessible
$rcpt = [$rcpt]
if $operation eq 'missing_dbd'
or $operation eq 'no_db'
or $operation eq 'db_restored';
or $operation eq 'no_db'
or $operation eq 'db_restored';
my $message = Sympa::Message::Template->new(
context => $robot_id,
......
......@@ -253,7 +253,7 @@ sub next {
!/,lock/
and !m{(?:\A|/)(?:\.|T\.|BAD-)}
and -f ($self->{directory} . '/' . $_)
} readdir $dh
} readdir $dh
];
closedir $dh;
......@@ -311,7 +311,7 @@ sub html_next {
!/,lock/
and !m{(?:\A|/)(?:\.|T\.|BAD-)}
and -f ($self->{arc_directory} . '/' . $_)
} readdir $dh
} readdir $dh
];
closedir $dh;
......@@ -569,7 +569,7 @@ sub get_archives {
my @arcs =
grep {
/\A\d\d\d\d\-\d\d\z/
and -d $base_directory . '/'
and -d $base_directory . '/'
. $_
. '/arctxt'
}
......
......@@ -141,7 +141,7 @@ sub authentication {
next if ($email !~ /$auth_service->{'regexp'}/i);
next
if $auth_service->{'negative_regexp'}
and $email =~ /$auth_service->{'negative_regexp'}/i;
and $email =~ /$auth_service->{'negative_regexp'}/i;
## Only 'user_table' and 'ldap' backends will need that Sympa collects
## the user passwords
......
......@@ -98,7 +98,7 @@ sub next {
!/,lock/
and !m{(?:\A|/)(?:\.|T\.|BAD-)}
and -f ($self->{pct_directory} . '/' . $_)
} glob '*/*'
} glob '*/*'
];
chdir $cwd;
}
......
......@@ -152,7 +152,7 @@ our %comms = (
# SET EACH is a synonym for SET MAIL.
$r->{reception} = 'mail'
if grep { $r->{reception} eq $_ }
qw(each eachmail nodigest normal);
qw(each eachmail nodigest normal);
}
if ($r->{visibility}) {
$r->{visibility} = lc $r->{visibility};
......@@ -175,7 +175,7 @@ our %comms = (
# SET EACH is a synonym for SET MAIL.
$r->{reception} = 'mail'
if grep { $r->{reception} eq $_ }
qw(each eachmail nodigest normal);
qw(each eachmail nodigest normal);
}
if ($r->{visibility}) {
$r->{visibility} = lc $r->{visibility};
......
......@@ -101,9 +101,9 @@ sub _connect {
$self->{_hosts},
timeout => ($self->{'timeout'} || 3),
verify => (
(not $self->{ca_verify}) ? 'optional'
(not $self->{ca_verify}) ? 'optional'
: ($self->{ca_verify} eq 'required') ? 'require'
: $self->{ca_verify}
: $self->{ca_verify}
),
capath => $self->{'ca_path'},
cafile => $self->{'ca_file'},
......@@ -128,9 +128,9 @@ sub _connect {
if ($self->{use_tls} eq 'starttls') {
my $mesg = $connection->start_tls(
verify => (
(not $self->{ca_verify}) ? 'optional'
(not $self->{ca_verify}) ? 'optional'
: ($self->{ca_verify} eq 'required') ? 'require'
: $self->{ca_verify}
: $self->{ca_verify}
),
capath => $self->{'ca_path'},
cafile => $self->{'ca_file'},
......
......@@ -158,7 +158,7 @@ sub get_tables {
}
foreach my $t (@raw_tables) {
$t =~ s/^"main"\.//; # needed for SQLite 3
$t =~ s/^"main"\.//; # needed for SQLite 3
$t =~ s/^.*\"([^\"]+)\"$/$1/;
push @result, $t;
}
......
......@@ -52,7 +52,7 @@ sub instance {
return undef
unless $self = Sympa::Database->new($db_conf->{'db_type'}, %$db_conf)
and $self->connect;
and $self->connect;
# At once connection succeeded, we keep trying to connect.
# Unless in a web context, because we can't afford long response time on
......
......@@ -993,8 +993,8 @@ sub instantiate {
);
} else {
$self->{'created_lists'}{'without_aliases'}{$list->{'name'}} =
$result->{'aliases'};
$self->{'created_lists'}{'without_aliases'}{$list->{'name'}}
= $result->{'aliases'};
}
# config_changes
......
......@@ -62,9 +62,9 @@ sub validate_src_attribute {
if (my $url_prefix = $self->{_shsURLPrefix}) {
return $text
if $text eq $url_prefix
or 0 == index($text, $url_prefix . '/')
or 0 == index($text, $url_prefix . '?')
or 0 == index($text, $url_prefix . '#');
or 0 == index($text, $url_prefix . '/')
or 0 == index($text, $url_prefix . '?')
or 0 == index($text, $url_prefix . '#');
}
return undef;
......
......@@ -1321,8 +1321,8 @@ sub get_digest_recipients_per_mode {
return 0
unless @tabrcpt_summary
or @tabrcpt_digest
or @tabrcpt_digestplain;
or @tabrcpt_digest
or @tabrcpt_digestplain;
my $available_recipients;
$available_recipients->{'summary'} = \@tabrcpt_summary
......@@ -1403,7 +1403,7 @@ sub get_recipients_per_mode {
# Check if "not_me" reception mode is set.
next
if $user->{'reception'} eq 'not_me'
and $message->{sender} eq $user->{'email'};
and $message->{sender} eq $user->{'email'};
# Recipients who won't receive encrypted messages.
# The digest, digestplain, nomail and summary reception option are
......@@ -1489,15 +1489,15 @@ sub get_recipients_per_mode {
return 0
unless @tabrcpt_mail
or @tabrcpt_notice
or @tabrcpt_txt
or @tabrcpt_html
or @tabrcpt_urlize
or @tabrcpt_mail_verp
or @tabrcpt_notice_verp
or @tabrcpt_txt_verp
or @tabrcpt_html_verp
or @tabrcpt_urlize_verp;
or @tabrcpt_notice
or @tabrcpt_txt
or @tabrcpt_html
or @tabrcpt_urlize
or @tabrcpt_mail_verp
or @tabrcpt_notice_verp
or @tabrcpt_txt_verp
or @tabrcpt_html_verp
or @tabrcpt_urlize_verp;
my $available_recipients;
......@@ -3376,8 +3376,8 @@ sub get_resembling_members {
my $initial = $1 if defined $first and $first =~ /\A([a-z])/;
$initial .= $1
if defined $initial
and defined $name
and $name =~ /\A([a-z])/;
and defined $name
and $name =~ /\A([a-z])/;
my ($top, $upperdomain) = split /[.]/, $domain, 2;
my @cond;
......@@ -3642,7 +3642,8 @@ sub update_list_member {
# Delete subscription / signoff requests no longer used.
my $new_email;
if ($who ne '*' and $values->{'email'}
if ( $who ne '*'
and $values->{'email'}
and $new_email = Sympa::Tools::Text::canonic_email($values->{'email'})
and $who ne $new_email) {
my $spool_req;
......@@ -3958,8 +3959,8 @@ sub add_list_member {
) {
$log->syslog('err', 'Unable to add user %s to user_table',
$who);
$self->{'add_outcome'}{'errors'}
{'unable_to_add_to_database'} = 1;
$self->{'add_outcome'}{'errors'}{'unable_to_add_to_database'}
= 1;
next;
}
}
......@@ -4377,7 +4378,7 @@ sub may_do {
return undef unless ($admin);
$action =~ y/A-Z/a-z/;
$who =~ y/A-Z/a-z/;
$who =~ y/A-Z/a-z/;
if ($action =~ /^(index|get)$/io) {
my $arc_access = $admin->{'archive'}{'mail_access'};
......@@ -4415,7 +4416,7 @@ sub may_do {
return undef
unless $self->is_list_member($who)
or $self->is_admin('owner', $who);
or $self->is_admin('owner', $who);
} elsif (
$admin->{'send'} =~ /^(editor|editorkey|privateoreditorkey)$/i) {
return undef unless $self->is_admin('actual_editor', $who);
......@@ -4440,13 +4441,13 @@ sub may_do {
if ($admin->{'send'} =~ /^(privatekey)$/io) {
return 1
if $self->is_list_member($who)
or $self->is_admin('owner', $who)
or Sympa::is_listmaster($self, $who);
or $self->is_admin('owner', $who)
or Sympa::is_listmaster($self, $who);
} elsif ($admin->{'send'} =~ /^(privateorpublickey)$/io) {
return 1
unless $self->is_list_member($who)
or $self->is_admin('owner', $who)
or Sympa::is_listmaster($self, $who);
or $self->is_admin('owner', $who)
or Sympa::is_listmaster($self, $who);
} elsif ($admin->{'send'} =~ /^(publickey)$/io) {
return 1;
}
......@@ -4495,7 +4496,7 @@ sub is_web_archived {
my $self = shift;
return 1
if ref $self->{'admin'}{'archive'} eq 'HASH'
and $self->{'admin'}{'archive'}{'web_access'};
and $self->{'admin'}{'archive'}{'web_access'};
return undef;
}
......@@ -5640,7 +5641,7 @@ sub _include_users_ldap_2level {
next
if $ldap_select2 eq 'regex'
and $cleanmail !~ /$ldap_regex2/;
and $cleanmail !~ /$ldap_regex2/;
next if $emailsViewed{$cleanmail};
push @emails, [$cleanmail, $gecosentry];
$emailsViewed{$cleanmail} = 1;
......@@ -5658,7 +5659,7 @@ sub _include_users_ldap_2level {
next
if $ldap_select2 eq 'regex'
and $cleanmail !~ /$ldap_regex2/;
and $cleanmail !~ /$ldap_regex2/;
next if $emailsViewed{$cleanmail};
push @emails, [$cleanmail, $gecosentry];
$emailsViewed{$cleanmail} = 1;
......@@ -5945,7 +5946,7 @@ sub _load_list_members_from_include {
my $sources = {
map {
($_ => (Sympa::Tools::Data::dup_var($self->{'admin'}{$_}) || []))
} @sources_providing_listmembers
} @sources_providing_listmembers
};
my %users;
......@@ -6215,7 +6216,7 @@ sub _load_list_members_from_include {
$self->{'domain'}
unless 0 < index($source_id, '@');
$source_id
} @depend_on
} @depend_on
)
],
};
......@@ -6435,7 +6436,7 @@ sub _load_list_admin_from_include {
$self->{'domain'}
unless 0 < index($source_id, '@');
$source_id
} @depend_on
} @depend_on
)
],
};
......@@ -6627,8 +6628,8 @@ sub _load_include_admin_user_file {
## Default value
unless (defined $hash{$k}) {
if (defined $pinfo->{$pname}{'file_format'}{$k}
{'default'}) {
if (defined $pinfo->{$pname}{'file_format'}{$k}{'default'}
) {
$hash{$k} =
$self->_load_list_param($k, 'default',
$pinfo->{$pname}{'file_format'}{$k});
......@@ -6938,19 +6939,16 @@ sub sync_include {
$old_subscribers{$email}{'update_date'};
$new_subscribers->{$email}{'visibility'} =
$self->get_default_user_options->{'visibility'}
if
defined $self->get_default_user_options->{
'visibility'};
if defined $self->get_default_user_options->{
'visibility'};
$new_subscribers->{$email}{'reception'} =
$self->get_default_user_options->{'reception'}
if
defined $self->get_default_user_options->{
'reception'};
if defined $self->get_default_user_options->{
'reception'};
$new_subscribers->{$email}{'profile'} =
$self->get_default_user_options->{'profile'}
if
defined $self->get_default_user_options->{
'profile'};
if defined $self->get_default_user_options->{
'profile'};
$new_subscribers->{$email}{'info'} =
$self->get_default_user_options->{'info'}
if
......@@ -8511,7 +8509,7 @@ sub _save_list_param {
## Skip if empty value
next
unless defined $p->{$k}{'name'}
and $p->{$k}{'name'} =~ /\S/;
and $p->{$k}{'name'} =~ /\S/;
$fd->print(sprintf "%s %s\n", $k, $p->{$k}{'name'});
......@@ -8848,8 +8846,8 @@ sub _load_list_config_file {
## Default value
unless (defined $hash{$k}) {
if (defined $pinfo->{$pname}{'file_format'}{$k}
{'default'}) {
if (defined $pinfo->{$pname}{'file_format'}{$k}{'default'}
) {
$hash{$k} =
$self->_load_list_param($k, 'default',
$pinfo->{$pname}{'file_format'}{$k});
......@@ -9648,9 +9646,9 @@ sub remove_aliases {
return undef
unless $self
and $list_of_lists{$self->{'domain'}}{$self->{'name'}}
and Conf::get_robot_conf($self->{'domain'}, 'sendmail_aliases') !~
/^none$/i;
and $list_of_lists{$self->{'domain'}}{$self->{'name'}}
and Conf::get_robot_conf($self->{'domain'}, 'sendmail_aliases') !~
/^none$/i;
my $alias_manager = $Conf::Conf{'alias_manager'};
......
......@@ -41,7 +41,7 @@ BEGIN {
*File::NFSLock::rand_file = sub($) {
my $file = shift;
return
$file
$file
. ',lock.'
. time() % 10000 . '.'
. $PID . '.'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment