Skip to content

Commit b5b6848

Browse files
authored
Merge pull request #1979 from ikedas/issue-1977 by ikedas
WWSympa: Cannot send messages using web interface on a fully moderated list (#1977)
2 parents 1e4196c + f4acfe5 commit b5b6848

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

src/cgi/wwsympa.fcgi.in

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2471,14 +2471,20 @@ sub check_param_in {
24712471
$list->find_picture_url($param->{'user'}{'email'});
24722472

24732473
# Checks if the user can post in this list.
2474-
my $authz_action = Sympa::Scenario->new($list, 'send')->authz(
2475-
$param->{'auth_method'},
2476-
{ 'sender' => $param->{'user'}{'email'},
2477-
'remote_host' => $param->{'remote_host'},
2478-
'remote_addr' => $param->{'remote_addr'}
2479-
}
2480-
)->{action};
2481-
$param->{'may_post'} = 1 unless $authz_action =~ /reject/;
2474+
my ($authz_action, $authz_reason) =
2475+
@{Sympa::Scenario->new($list, 'send')->authz(
2476+
$param->{'auth_method'},
2477+
{ 'sender' => $param->{'user'}{'email'},
2478+
'remote_host' => $param->{'remote_host'},
2479+
'remote_addr' => $param->{'remote_addr'}
2480+
}
2481+
)
2482+
}{qw(action reason)};
2483+
unless ($authz_action =~ /reject/) {
2484+
$param->{'may_post'} = $authz_action;
2485+
} else {
2486+
$param->{'may_post_reason'} = $authz_reason;
2487+
}
24822488
} else {
24832489
# If no user logged in, the output can ask for authentication.
24842490
$param->{'user'}{'email'} = undef;
@@ -2701,19 +2707,6 @@ sub check_param_out {
27012707
$param->{'is_priv'} = $param->{'is_owner'}
27022708
|| $param->{'is_editor'};
27032709

2704-
# May post.
2705-
my ($authz_action, $authz_reason) =
2706-
@{Sympa::Scenario->new($list, 'send')->authz(
2707-
$param->{'auth_method'},
2708-
{ 'sender' => $param->{'user'}{'email'},
2709-
'remote_host' => $param->{'remote_host'},
2710-
'remote_addr' => $param->{'remote_addr'}
2711-
}
2712-
)
2713-
}{qw(action reason)};
2714-
$param->{'may_post'} = ($authz_action =~ /do_it/) ? 1 : undef
2715-
or $param->{'may_post_reason'} = $authz_reason;
2716-
27172710
$param->{'may_include'} = {
27182711
member => (
27192712
$param->{'is_owner'}

0 commit comments

Comments
 (0)