Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Sympa
Commits
366cb22c
Commit
366cb22c
authored
Nov 30, 2018
by
Luc Didry
Committed by
IKEDA Soji
Dec 01, 2018
Browse files
Fix code tidying
parent
52ec781a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/lib/Sympa/List.pm
View file @
366cb22c
...
...
@@ -5794,25 +5794,24 @@ sub _load_list_members_from_include {
}
my $include_member;
my %parsing;
my %parsing;
$parsing{'data'} = $entry->{'source_parameters'};
$parsing{'template'} = "$entry->{'source'}\.incl";
$parsing{'data'} = $entry->{'source_parameters'};
$parsing{'template'} = "$entry->{'source'}\.incl";
my $name = "$entry->{'source'}\.incl";
my $name = "$entry->{'source'}\.incl";
my $include_path = $include_file;
if ($include_path =~ s/$name$//) {
$parsing{'include_path'} = $include_path;
$include_member =
$self->_load_include_admin_user_file($include_path,
\%parsing);
} else {
$log->syslog('err',
'Errors to get path of the the file %s.incl',
$entry->{'source'});
return undef;
}
my $include_path = $include_file;
if ($include_path =~ s/$name$//) {
$parsing{'include_path'} = $include_path;
$include_member =
$self->_load_include_admin_user_file($include_path,
\%parsing);
} else {
$log->syslog('err', 'Errors to get path of the the file %s.incl',
$entry->{'source'});
return undef;
}
if ($include_member and %$include_member) {
foreach my $type (@sources_providing_listmembers) {
...
...
@@ -6078,25 +6077,24 @@ sub _load_list_admin_from_include {
}
my $include_admin_user;
my %parsing;
my %parsing;
$parsing{'data'} = $entry->{'source_parameters'};
$parsing{'template'} = "$entry->{'source'}\.incl";
$parsing{'data'} = $entry->{'source_parameters'};
$parsing{'template'} = "$entry->{'source'}\.incl";
my $name = "$entry->{'source'}\.incl";
my $name = "$entry->{'source'}\.incl";
my $include_path = $include_file;
if ($include_path =~ s/$name$//) {
$parsing{'include_path'} = $include_path;
$include_admin_user =
$self->_load_include_admin_user_file($include_path,
\%parsing);
} else {
$log->syslog('err',
'Errors to get path of the the file %s.incl',
$entry->{'source'});
return undef;
}
my $include_path = $include_file;
if ($include_path =~ s/$name$//) {
$parsing{'include_path'} = $include_path;
$include_admin_user =
$self->_load_include_admin_user_file($include_path,
\%parsing);
} else {
$log->syslog('err', 'Errors to get path of the the file %s.incl',
$entry->{'source'});
return undef;
}
foreach my $type (@sources_providing_listmembers) {
defined $total or last;
...
...
@@ -6269,28 +6267,28 @@ sub _load_include_admin_user_file {
my %include;
my (@paragraphs);
my @data = split(',', $parsing->{'data'}) if defined $parsing->{'data'};
my $vars = {'param' => \@data};
my $output = '';
my @data = split(',', $parsing->{'data'}) if defined $parsing->{'data'};
my $vars = {'param' => \@data};
my $output = '';
my $template =
Sympa::Template->new(undef,
include_path => [$parsing->{'include_path'}]);
unless ($template->parse($vars, $parsing->{'template'}, \$output)) {
$log->syslog('err', 'Failed to parse %s', $parsing->{'template'});
return undef;
}
my $template =
Sympa::Template->new(undef,
include_path => [$parsing->{'include_path'}]);
unless ($template->parse($vars, $parsing->{'template'}, \$output)) {
$log->syslog('err', 'Failed to parse %s', $parsing->{'template'});
return undef;
}
my @lines = split('\n', $output);
my @lines = split('\n', $output);
my $i = 0;
foreach my $line (@lines) {
if ($line =~ /^\s*$/) {
$i++ if $paragraphs[$i];
} else {
push @{$paragraphs[$i]}, $line;
}
my $i = 0;
foreach my $line (@lines) {
if ($line =~ /^\s*$/) {
$i++ if $paragraphs[$i];
} else {
push @{$paragraphs[$i]}, $line;
}
}
for my $index (0 .. $#paragraphs) {
my @paragraph = @{$paragraphs[$index]};
...
...
src/lib/Sympa/Tools/Text.pm
View file @
366cb22c
...
...
@@ -160,7 +160,7 @@ sub encode_filesystem_safe {
}
sub
encode_html
{
my
$str
=
shift
;
my
$str
=
shift
;
my
$additional_unsafe
=
shift
||
'';
HTML::Entities::
encode_entities
(
$str
,
'
<>&"
'
.
$additional_unsafe
);
...
...
src/sbin/sympa.pl.in
View file @
366cb22c
...
...
@@ -62,31 +62,32 @@ srand(time());
my
%options
;
unless
(
GetOptions
(
\
%
main::
options
,
'
dump=s
',
'
debug|d
',
'
log_level=s
',
'
config|f=s
',
'
lang|l=s
',
'
mail|m
',
'
help|h
',
'
version|v
',
'
import=s
',
'
make_alias_file
',
'
lowercase
',
'
sync_list_db
',
'
md5_encode_password
',
'
close_list=s
',
'
rename_list=s
',
'
copy_list=s
',
'
new_listname=s
',
'
new_listrobot=s
',
'
purge_list=s
',
'
create_list
',
'
instantiate_family=s
',
'
robot=s
',
'
add_list=s
',
'
modify_list=s
',
'
close_family=s
',
'
md5_digest=s
',
'
change_user_email
',
'
current_email=s
',
'
new_email=s
',
'
input_file=s
',
'
sync_include=s
',
'
upgrade
',
'
upgrade_shared
',
'
from=s
',
'
to=s
',
'
reload_list_config
',
'
list=s
',
'
quiet
',
'
close_unknown
',
'
test_database_message_buffer
',
'
conf_2_db
',
'
export_list
',
'
health_check
',
'
send_digest
',
'
keep_digest
',
'
upgrade_config_location
',
'
role=s
',
'
dump_users
',
'
restore_users
',
'
open_list=s
',
\
%
main::
options
,
'
dump=s
',
'
debug|d
',
'
log_level=s
',
'
config|f=s
',
'
lang|l=s
',
'
mail|m
',
'
help|h
',
'
version|v
',
'
import=s
',
'
make_alias_file
',
'
lowercase
',
'
sync_list_db
',
'
md5_encode_password
',
'
close_list=s
',
'
rename_list=s
',
'
copy_list=s
',
'
new_listname=s
',
'
new_listrobot=s
',
'
purge_list=s
',
'
create_list
',
'
instantiate_family=s
',
'
robot=s
',
'
add_list=s
',
'
modify_list=s
',
'
close_family=s
',
'
md5_digest=s
',
'
change_user_email
',
'
current_email=s
',
'
new_email=s
',
'
input_file=s
',
'
sync_include=s
',
'
upgrade
',
'
upgrade_shared
',
'
from=s
',
'
to=s
',
'
reload_list_config
',
'
list=s
',
'
quiet
',
'
close_unknown
',
'
test_database_message_buffer
',
'
conf_2_db
',
'
export_list
',
'
health_check
',
'
send_digest
',
'
keep_digest
',
'
upgrade_config_location
',
'
role=s
',
'
dump_users
',
'
restore_users
',
'
open_list=s
',
)
)
{
pod2usage
(
-
exitval
=>
1
,
-
output
=>
\
*STDERR
);
...
...
@@ -631,14 +632,13 @@ if ($main::options{'dump'} or $main::options{'dump_users'}) {
exit
1
;
}
exit
0
;
}
elsif
(
$
main::
options
{'
copy_list
'})
{
my
$current_list
=
Sympa::
List
->
new
(
split
(
/\@/
,
$
main::
options
{'
copy_list
'},
2
),
{
just_try
=>
1
});
unless
(
$current_list
)
{
printf
STDERR
"
Incorrect list name %s
\n
",
$
main::
options
{'
copy_list
'};
printf
STDERR
"
Incorrect list name %s
\n
",
$
main::
options
{'
copy_list
'};
exit
1
;
}
...
...
@@ -663,7 +663,7 @@ if ($main::options{'dump'} or $main::options{'dump_users'}) {
action
=>
'
move_list
',
current_list
=>
$current_list
,
listname
=>
$listname
,
mode
=>
'
copy
',
mode
=>
'
copy
',
sender
=>
Sympa::
get_address
(
$robot_id
,
'
listmaster
'),
scenario_context
=>
{
skip
=>
1
},
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment