Commit 0b1876ff authored by IKEDA Soji's avatar IKEDA Soji
Browse files

Prevent the use of the list owner/moderator address as owner/moderator, too

parent a88a5e42
......@@ -664,7 +664,13 @@ Warning: this message may already have been sent by one of the list's moderators
[%|loc(report_param.email || report_param.value)%]Address "%1" belongs to a blocklisted domain[%END%]
[%~ ELSIF report_entry == 'email_is_the_list' ~%]
[%|loc(report_param.email || report_param.value)%]Address "%1" is the address of the list[%END%]
[% IF report_param.role == 'owner' ~%]
[%|loc(report_param.email)%]Address "%1" is the address for the list owners[%END%]
[%~ ELSIF report_param.role == 'editor' ~%]
[%|loc(report_param.email)%]Address "%1" is the address for the list moderators[%END%]
[%~ ELSE ~%]
[%|loc(report_param.email)%]Address "%1" is the address of the list[%END%]
[%~ END %]
[%~ ELSIF report_entry == 'incorrect_passwd' ~%]
[%|loc%]Provided password is incorrect[%END%]
......
......@@ -3360,6 +3360,15 @@ sub _add_list_admin {
}
my $who = Sympa::Tools::Text::canonic_email($u->{email});
if ($who eq Sympa::get_address($self, $role)) {
$log->syslog('err',
'Ignoring %s which is the address for the list %s',
$who, $role);
push @$stash_ref,
['user', 'email_is_the_list', {email => $who, role => $role}];
return undef;
}
my $values = $self->get_default_user_options(role => $role);
while (my ($k, $v) = each %$u) {
$values->{$k} = $v if defined $v;
......
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