Commit c6acbbd6 authored by IKEDA Soji's avatar IKEDA Soji
Browse files

Prevent the use of the list address as owner or moderator #297

parent bd057ed6
......@@ -121,6 +121,20 @@ use constant _global_validations => {
};
use constant _local_validations => {
# Checking that list owner/editor address is not set to list address.
list_address => sub {
my $self = shift;
my $new = shift;
my $list = $self->{context};
my $email = Sympa::Tools::Text::canonic_email($new);
return 'syntax_errors'
unless defined $email;
return 'incorrect_email'
if Sympa::get_address($list) eq $email;
},
# Checking that list editor address is not set to editor special address.
list_editor_address => sub {
my $self = shift;
......@@ -133,7 +147,7 @@ use constant _local_validations => {
unless defined $email;
return 'incorrect_email'
if Sympa::get_address($list, 'editor') eq $new;
if Sympa::get_address($list, 'editor') eq $email;
},
# Checking that list owner address is not set to one of the special
# addresses.
......
......@@ -2492,14 +2492,15 @@ our %user_info = (
'Owners are managing subscribers of the list. They may review subscribers and add or delete email addresses from the mailing list. If you are a privileged owner of the list, you can choose other owners for the mailing list. Privileged owners may edit a few more options than other owners. ',
format => {
email => {
order => 2,
gettext_id => "email address",
format_s => '$email',
occurrence => '1',
length => 30,
filters => ['canonic_email'],
validations =>
[qw(list_special_addresses unique_paragraph_key)],
order => 2,
gettext_id => "email address",
format_s => '$email',
occurrence => '1',
length => 30,
filters => ['canonic_email'],
validations => [
qw(list_address list_special_addresses unique_paragraph_key)
],
},
gecos => {
order => 3,
......@@ -2587,7 +2588,9 @@ our %user_info = (
occurrence => '1',
length => 30,
filters => ['canonic_email'],
validations => [qw(list_editor_address unique_paragraph_key)],
validations => [
qw(list_address list_editor_address unique_paragraph_key)
],
},
gecos => {
order => 2,
......
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