Commit e2a40456 authored by IKEDA Soji's avatar IKEDA Soji

More fix: An attribute $family->{robot} renamed to $family->{domain}.

parent 32d19539
......@@ -2727,7 +2727,7 @@ sub check_param_in {
next unless $family;
my $result =
Sympa::Scenario->new($family->{'robot'},
Sympa::Scenario->new($family->{'domain'},
'automatic_list_creation')->authz(
$param->{'auth_method'},
{ 'sender' => $param->{'user'}{'email'},
......
......@@ -174,7 +174,7 @@ sub _get_search_path {
}
} elsif (ref $that and ref $that eq 'Sympa::Family') {
my $path_family;
@search_path = _get_search_path($that->{'robot'}, @_);
@search_path = _get_search_path($that->{'domain'}, @_);
if ($subdir) {
$path_family = $that->{'dir'} . '/' . $subdir;
......@@ -616,7 +616,7 @@ sub get_address {
}
} elsif (ref $that eq 'Sympa::Family') {
# robot address, for convenience.
return Sympa::get_address($that->{'robot'}, $type);
return Sympa::get_address($that->{'domain'}, $type);
} else {
unless ($type) {
return Conf::get_robot_conf($that, 'email') . '@'
......@@ -654,7 +654,7 @@ sub get_listmasters_email {
if (ref $that eq 'Sympa::List') {
$listmaster = Conf::get_robot_conf($that->{'domain'}, 'listmaster');
} elsif (ref $that eq 'Sympa::Family') {
$listmaster = Conf::get_robot_conf($that->{'robot'}, 'listmaster');
$listmaster = Conf::get_robot_conf($that->{'domain'}, 'listmaster');
} elsif (not ref($that) and $that and $that ne '*') {
$listmaster = Conf::get_robot_conf($that, 'listmaster');
} else {
......
......@@ -8,8 +8,8 @@
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2017, 2018, 2019 The Sympa Community. See the AUTHORS.md file
# at the top-level directory of this distribution and at
# Copyright 2017, 2018, 2019, 2020 The Sympa Community. See the AUTHORS.md
# file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
......@@ -103,7 +103,7 @@ sub new {
$self = $list_of_families{$robot}{$name};
###########
# the robot can be different from latest new ...
if ($robot eq $self->{'robot'}) {
if ($robot eq $self->{'domain'}) {
return $self;
} else {
$self = {};
......@@ -123,9 +123,10 @@ sub new {
## Lowercase the family name.
$name =~ tr/A-Z/a-z/;
$self->{'name'} = $name;
$self->{'name'} = $name;
$self->{'domain'} = $robot;
$self->{'robot'} = $robot;
$self->{'robot'} = $self->{'domain'}; # Compat.<=6.2.52
## Adding configuration related to automatic lists.
my $all_families_config =
......@@ -354,10 +355,11 @@ sub get_uncompellable_param {
# finally in the distrib.
# OUT : -directory name or undef if the directory does not exist
sub _get_directory {
$log->syslog('debug3', '(%s)', @_);
my $self = shift;
my $robot = $self->{'robot'};
my $name = $self->{'name'};
$log->syslog('debug3', '(%s)', $name);
my $robot = $self->{'domain'};
my @try = @{Sympa::get_search_path($robot, subdir => 'families')};
......@@ -471,7 +473,7 @@ sub _load_param_constraint_conf {
}
}
if ($error) {
Sympa::send_notify_to_listmaster($self->{'robot'},
Sympa::send_notify_to_listmaster($self->{'domain'},
'param_constraint_conf_error', [$file]);
}
close FILE;
......@@ -501,7 +503,7 @@ sub insert_delete_exclusion {
my $action = shift;
my $name = $self->{'name'};
my $robot_id = $self->{'robot'};
my $robot_id = $self->{'domain'};
if ($action eq 'insert') {
##FXIME: Check if user belong to any list of family
......@@ -539,8 +541,8 @@ sub insert_delete_exclusion {
sub get_id {
my $self = shift;
return '' unless $self->{'name'} and $self->{'robot'};
return $self->{'name'} . '@' . $self->{'robot'};
return '' unless $self->{'name'} and $self->{'domain'};
return sprintf '%s@%s', $self->{'name'}, $self->{'domain'};
}
1;
......@@ -757,9 +759,12 @@ Gets unique identifier of instance.
The name of family.
=item {robot}
=item {domain}
The mail domain (a.k.a. "robot") the family belongs to.
The robot the family belongs to.
B<Note>:
On Sympa 6.2.52 or earlier, C<{robot}> was used.
=item {dir}
......
......@@ -5108,7 +5108,7 @@ sub get_lists {
my (@lists, @robot_ids, $family_name);
if (ref $that and ref $that eq 'Sympa::Family') {
@robot_ids = ($that->{'robot'});
@robot_ids = ($that->{'domain'});
$family_name = $that->{'name'};
} elsif (!ref $that and $that and $that ne '*') {
@robot_ids = ($that);
......
......@@ -8,8 +8,8 @@
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2017, 2018, 2019 The Sympa Community. See the AUTHORS.md file at
# the top-level directory of this distribution and at
# Copyright 2017, 2018, 2019, 2020 The Sympa Community. See the AUTHORS.md
# file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
......@@ -649,6 +649,8 @@ sub check_dkim_signature {
my $robot_id =
(ref $self->{context} eq 'Sympa::List')
? $self->{context}->{'domain'}
: (ref $self->{context} eq 'Sympa::Family')
? $self->{context}->{'domain'}
: $self->{context};
return
......@@ -1569,7 +1571,8 @@ sub personalize_text {
my $robot_id = $list->{'domain'};
$data->{'listname'} = $listname;
$data->{'robot'} = $robot_id;
$data->{'domain'} = $robot_id;
$data->{'robot'} = $data->{'domain'}; # Compat.<=6.2.52.
$data->{'wwsympa_url'} = Conf::get_robot_conf($robot_id, 'wwsympa_url');
my $message_output;
......
......@@ -8,8 +8,8 @@
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2018 The Sympa Community. See the AUTHORS.md file at the
# top-level directory of this distribution and at
# Copyright 2018, 2020 The Sympa Community. See the AUTHORS.md
# file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
......@@ -71,9 +71,9 @@ sub new {
$list = $that;
$domain = $that->{'domain'};
} elsif (ref $that eq 'Sympa::Family') {
$robot_id = $that->{'robot'}; #FIXME
$robot_id = $that->{'domain'};
$family = $that;
$domain = $that->{'robot'};
$domain = $that->{'domain'};
} elsif ($that and $that ne '*') {
$robot_id = $that;
$domain = Conf::get_robot_conf($that, 'domain');
......@@ -260,7 +260,7 @@ sub _new_from_template {
$robot_id = $list->{'domain'};
} elsif (ref $that eq 'Sympa::Family') {
$family = $that;
$robot_id = $family->{'robot'};
$robot_id = $family->{'domain'};
} elsif ($that and $that ne '*') {
$robot_id = $that;
} else {
......
......@@ -8,8 +8,8 @@
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2017, 2019 The Sympa Community. See the AUTHORS.md file at
# the top-level directory of this distribution and at
# Copyright 2017, 2019, 2020 The Sympa Community. See the AUTHORS.md
# file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
......@@ -144,7 +144,10 @@ sub cmd_line {
if (ref $context eq 'Sympa::List') {
@attrs{qw(localpart domainpart)} =
split /\@/, Sympa::get_address($context);
} else { #FIXME:handle Sympa::Family too
} elsif (ref $context eq 'Sympa::Family') {
#FIXME:family name
$attrs{domainpart} = $context->{'domain'};
} else {
$attrs{domainpart} = $context;
}
return sprintf $cmd_format,
......@@ -161,7 +164,9 @@ sub dup {
unless (Scalar::Util::blessed($val)) {
$clone->{$key} = Sympa::Tools::Data::dup_var($val);
} elsif ($val->can('dup') and !$val->isa('Sympa::List')) {
} elsif ($val->can('dup')
and !$val->isa('Sympa::List')
and !$val->isa('Sympa::Family')) {
$clone->{$key} = $val->dup;
} else {
$clone->{$key} = $val;
......
......@@ -4,8 +4,8 @@
# Sympa - SYsteme de Multi-Postage Automatique
#
# Copyright 2017, 2018, 2019 The Sympa Community. See the AUTHORS.md file
# at the top-level directory of this distribution and at
# Copyright 2017, 2018, 2019, 2020 The Sympa Community. See the AUTHORS.md
# file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
......@@ -53,7 +53,7 @@ sub _twist {
my $family = $request->{context};
my $param = $request->{parameters};
my $abort_on_error = $request->{abort_on_error};
my $robot_id = $family->{'robot'};
my $robot_id = $family->{'domain'};
my $path;
......
......@@ -4,8 +4,8 @@
# Sympa - SYsteme de Multi-Postage Automatique
#
# Copyright 2018, 2019 The Sympa Community. See the AUTHORS.md file
# at the top-level directory of this distribution and at
# Copyright 2018, 2019, 2020 The Sympa Community. See the AUTHORS.md
# file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
......@@ -51,7 +51,7 @@ sub _twist {
my $family = $request->{context};
my $list = $request->{current_list};
my $param = $request->{parameters};
my $robot_id = $family->{'robot'};
my $robot_id = $family->{'domain'};
my $path;
......@@ -70,7 +70,7 @@ sub _twist {
# getting list
if ($list and $param->{listname}) {
unless ($list->get_id eq
sprintf('%s@%s', lc $param->{listname}, $family->{'robot'})) {
sprintf('%s@%s', lc $param->{listname}, $family->{'domain'})) {
$log->syslog('err', 'The list %s and list name %s mismatch',
$list, $param->{listname});
$self->add_stash($request, 'user', 'XXX');
......@@ -79,7 +79,7 @@ sub _twist {
} elsif (
$list
or ($list = Sympa::List->new(
$param->{listname}, $family->{'robot'},
$param->{listname}, $family->{'domain'},
{just_try => 1, no_check_family => 1}
)
)
......
......@@ -8,8 +8,8 @@
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2017, 2018, 2019 The Sympa Community. See the AUTHORS.md file
# at the top-level directory of this distribution and at
# Copyright 2017, 2018, 2019, 2020 The Sympa Community. See the AUTHORS.md
# file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
......
......@@ -8,8 +8,8 @@
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2017, 2019 The Sympa Community. See the AUTHORS.md file at
# the top-level directory of this distribution and at
# Copyright 2017, 2019, 2020 The Sympa Community. See the AUTHORS.md
# file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
......@@ -264,13 +264,13 @@ sub _twist {
return undef;
} elsif (
not( $spindle_req->success
and $list = Sympa::List->new($listname, $dyn_family->{robot}))
and $list = Sympa::List->new($listname, $dyn_family->{'domain'}, {just_try => 1}))
) {
$log->syslog('err',
'Unable to create list %s. Message %s ignored',
$listname, $message);
Sympa::send_notify_to_listmaster(
$dyn_family->{'robot'},
$dyn_family->{'domain'},
'automatic_list_creation_failed',
{ 'listname' => $listname,
'family' => $dyn_list_family,
......@@ -280,10 +280,10 @@ sub _twist {
);
Sympa::send_dsn($robot, $message, {}, '5.3.5');
$log->db_log(
'robot' => $dyn_family->{'robot'},
'robot' => $dyn_family->{'domain'},
'list' => $listname,
'action' => 'process_message',
'parameters' => $msg_id . "," . $dyn_family->{'robot'},
'parameters' => $msg_id . "," . $dyn_family->{'domain'},
'target_email' => '',
'msg_id' => $msg_id,
'status' => 'error',
......
......@@ -4,8 +4,8 @@
# Sympa - SYsteme de Multi-Postage Automatique
#
# Copyright 2019 The Sympa Community. See the AUTHORS.md file at
# the top-level directory of this distribution and at
# Copyright 2019, 2020 The Sympa Community. See the AUTHORS.md
# file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
......
......@@ -8,8 +8,8 @@
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2017, 2018 The Sympa Community. See the AUTHORS.md file at the
# top-level directory of this distribution and at
# Copyright 2017, 2018, 2020 The Sympa Community. See the AUTHORS.md
# file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
......@@ -309,7 +309,7 @@ sub _get_option_description {
if (ref $that eq 'Sympa::List') {
$robot_id = $that->{'domain'};
} elsif (ref $that eq 'Sympa::Family') {
$robot_id = $that->{'robot'};
$robot_id = $that->{'domain'};
} elsif ($that and $that ne '*') {
$robot_id = $that;
} else {
......@@ -371,7 +371,7 @@ sub _url_func {
my $that = $self->{context};
my $robot_id =
(ref $that eq 'Sympa::List') ? $that->{'domain'}
: (ref $that eq 'Sympa::Family') ? $that->{'robot'}
: (ref $that eq 'Sympa::Family') ? $that->{'domain'}
: ($that and $that ne '*') ? $that
: '*';
......
......@@ -9,8 +9,8 @@
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2017, 2018, 2019 The Sympa Community. See the AUTHORS.md file
# at the top-level directory of this distribution and at
# Copyright 2017, 2018, 2019, 2020 The Sympa Community. See the AUTHORS.md
# file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
......@@ -964,7 +964,7 @@ elsif ($main::options{'close_family'}) {
my $listname = $list->{'name'};
my $spindle = Sympa::Spindle::ProcessRequest->new(
context => $family->{'robot'},
context => $family->{'domain'},
action => 'close_list',
current_list => $list,
sender => Sympa::get_address($family, 'listmaster'),
......@@ -1284,7 +1284,7 @@ sub instantiate {
# EACH FAMILY LIST
foreach my $listname (@$list_to_generate) {
my $path = $family->{'dir'} . '/' . $listname . '.xml';
my $list = Sympa::List->new($listname, $family->{'robot'},
my $list = Sympa::List->new($listname, $family->{'domain'},
{no_check_family => 1});
if ($list) {
......@@ -1322,7 +1322,7 @@ sub instantiate {
next;
}
$list = Sympa::List->new($listname, $family->{'robot'},
$list = Sympa::List->new($listname, $family->{'domain'},
{no_check_family => 1});
## aliases
......@@ -1355,7 +1355,7 @@ sub instantiate {
foreach my $l (keys %{$previous_family_lists}) {
my $list;
unless ($list =
Sympa::List->new($l, $family->{'robot'}, {no_check_family => 1}))
Sympa::List->new($l, $family->{'domain'}, {no_check_family => 1}))
{
push(@{$family->{'errors'}{'previous_list'}}, $l);
next;
......@@ -1374,7 +1374,7 @@ sub instantiate {
}
if ($options{close_unknown} or $answer eq 'y') {
my $spindle = Sympa::Spindle::ProcessRequest->new(
context => $family->{'robot'},
context => $family->{'domain'},
action => 'close_list',
current_list => $list,
sender => Sympa::get_address($family, 'listmaster'),
......
Markdown is supported
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