Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Sympa
Commits
1d1f1169
Unverified
Commit
1d1f1169
authored
Nov 26, 2021
by
IKEDA Soji
Committed by
GitHub
Nov 26, 2021
Browse files
Merge pull request #1282 from ikedas/pr-1251_fix by ikedas
More refactoring for PR#1251
parents
99b646e4
11b54d4a
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/cgi/wwsympa.fcgi.in
View file @
1d1f1169
...
...
@@ -6874,13 +6874,6 @@ sub do_import {
#);
#return $next_action unless $next_action eq '1';
unless ($list->is_subscription_allowed) {
wwslog('info', 'List %s not open', $list);
add_stash('user', 'list_not_open',
{'status' => $list->{'admin'}{'status'}});
return $in{'previous_action'} || 'review';
}
my (@emails, @dnames);
foreach (split /\r\n|\r|\n/, $content) {
next unless /\S/;
...
...
@@ -6950,13 +6943,6 @@ sub do_add {
);
return $next_action unless $next_action eq '1';
unless ($list->is_subscription_allowed) {
wwslog('info', 'List %s not open', $list);
add_stash('user', 'list_not_open',
{'status' => $list->{'admin'}{'status'}});
return $in{'previous_action'} || 'review';
}
my $stash = [];
my $processed = 0;
foreach my $email (@emails) {
...
...
@@ -7066,13 +7052,6 @@ sub do_del {
);
return $next_action unless $next_action eq '1';
unless ($list->is_subscription_allowed) {
wwslog('info', 'List %s not open', $list);
add_stash('user', 'list_not_open',
{'status' => $list->{'admin'}{'status'}});
return $in{'previous_action'} || 'review';
}
my $stash = [];
my $processed = 0;
foreach my $email (@emails) {
...
...
src/lib/Sympa/Request/Handler/add.pm
View file @
1d1f1169
...
...
@@ -80,6 +80,7 @@ sub _twist {
$log
->
syslog
('
info
',
'
List %s not open
',
$list
);
$self
->
add_stash
(
$request
,
'
user
',
'
list_not_open
',
{'
status
'
=>
$list
->
{'
admin
'}{'
status
'}});
$self
->
{
finish
}
=
1
;
return
undef
;
}
if
(
Sympa::Tools::Domains::
is_blocklisted
(
$email
))
{
...
...
src/lib/Sympa/Request/Handler/del.pm
View file @
1d1f1169
...
...
@@ -66,6 +66,7 @@ sub _twist {
$log
->
syslog
('
info
',
'
List %s not open
',
$list
);
$self
->
add_stash
(
$request
,
'
user
',
'
list_not_open
',
{'
status
'
=>
$list
->
{'
admin
'}{'
status
'}});
$self
->
{
finish
}
=
1
;
return
undef
;
}
...
...
src/sbin/sympa.pl.in
View file @
1d1f1169
...
...
@@ -93,6 +93,7 @@ unless (
'
open_list=s
',
'
show_pending_lists=s
',
'
notify
',
'
rebuildarc=s
',
'
add=s
',
'
del=s
',
'
force|F
',
)
)
{
pod2usage
(
-
exitval
=>
1
,
-
output
=>
\
*STDERR
);
...
...
@@ -518,11 +519,6 @@ if ($main::options{'dump'} or $main::options{'dump_users'}) {
exit
1
;
}
unless
(
$
main::
options
{
force
}
or
$list
->
is_subscription_allowed
)
{
printf
STDERR
"
List %s not open
\n
",
$
main::
options
{'
add
'};
exit
1
;
}
$
main::
options
{'
role
'}
//
=
'
member
';
unless
(
grep
{
$
main::
options
{'
role
'}
eq
$_
}
qw(member owner editor)
)
{
printf
STDERR
"
Unknown role
\"
%s
\"
.
\n
",
$
main::
options
{'
role
'};
...
...
@@ -550,7 +546,7 @@ if ($main::options{'dump'} or $main::options{'dump_users'}) {
role
=>
$
main::
options
{'
role
'},
email
=>
[
@emails
],
gecos
=>
[
@dnames
],
force
=>
1
,
force
=>
$
main::
options
{'
force
'}
,
quiet
=>
$
main::
options
{'
quiet
'},
notify
=>
$
main::
options
{'
notify
'},
sender
=>
Sympa::
get_address
(
$list
,
'
listmaster
'),
...
...
@@ -575,11 +571,6 @@ if ($main::options{'dump'} or $main::options{'dump_users'}) {
exit
1
;
}
unless
(
$
main::
options
{
force
}
or
$list
->
is_subscription_allowed
)
{
printf
STDERR
"
List %s not open
\n
",
$
main::
options
{'
del
'};
exit
1
;
}
$
main::
options
{'
role
'}
//
=
'
member
';
unless
(
grep
{
$
main::
options
{'
role
'}
eq
$_
}
qw(member owner editor)
)
{
printf
STDERR
"
Unknown role
\"
%s
\"
.
\n
",
$
main::
options
{'
role
'};
...
...
@@ -605,7 +596,7 @@ if ($main::options{'dump'} or $main::options{'dump_users'}) {
action
=>
'
del
',
role
=>
$
main::
options
{'
role
'},
email
=>
[
@emails
],
force
=>
1
,
force
=>
$
main::
options
{'
force
'}
,
quiet
=>
$
main::
options
{'
quiet
'},
notify
=>
$
main::
options
{'
notify
'},
sender
=>
Sympa::
get_address
(
$list
,
'
listmaster
'),
...
...
t/Request_Handler_add+del.t
View file @
1d1f1169
...
...
@@ -117,8 +117,8 @@ my $editor3 =
do_test
(
request
=>
{
action
=>
'
add
',
email
=>
$member1
->
[
0
],
gecos
=>
$member1
->
[
1
],
email
=>
[
$member1
->
[
0
],
$member2
->
[
0
],],
gecos
=>
[
$member1
->
[
1
],
$member2
->
[
1
],],
},
result
=>
[[
qw(user list_not_open)
]],
data
=>
[]
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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