Unverified Commit 6526e85d authored by IKEDA Soji's avatar IKEDA Soji Committed by GitHub
Browse files

Merge branch 'sympa-6.2' into issue-893

parents d1bfa2fe d2a043dd
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, # Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites # 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER # Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2017, 2019 The Sympa Community. See the AUTHORS.md file at # Copyright 2017, 2019, 2020 The Sympa Community. See the AUTHORS.md
# the top-level directory of this distribution and at # file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>. # <https://github.com/sympa-community/sympa.git>.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
...@@ -144,6 +144,9 @@ sub cmd_line { ...@@ -144,6 +144,9 @@ sub cmd_line {
if (ref $context eq 'Sympa::List') { if (ref $context eq 'Sympa::List') {
@attrs{qw(localpart domainpart)} = @attrs{qw(localpart domainpart)} =
split /\@/, Sympa::get_address($context); split /\@/, Sympa::get_address($context);
} elsif (ref $context eq 'Sympa::Family') {
#FIXME:family name
$attrs{domainpart} = $context->{'domain'};
} else { } else {
$attrs{domainpart} = $context; $attrs{domainpart} = $context;
} }
...@@ -161,7 +164,9 @@ sub dup { ...@@ -161,7 +164,9 @@ sub dup {
unless (Scalar::Util::blessed($val)) { unless (Scalar::Util::blessed($val)) {
$clone->{$key} = Sympa::Tools::Data::dup_var($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; $clone->{$key} = $val->dup;
} else { } else {
$clone->{$key} = $val; $clone->{$key} = $val;
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
# Sympa - SYsteme de Multi-Postage Automatique # Sympa - SYsteme de Multi-Postage Automatique
# #
# Copyright 2017, 2018, 2019 The Sympa Community. See the AUTHORS.md file # Copyright 2017, 2018, 2019, 2020 The Sympa Community. See the AUTHORS.md
# at the top-level directory of this distribution and at # file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>. # <https://github.com/sympa-community/sympa.git>.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
...@@ -53,7 +53,7 @@ sub _twist { ...@@ -53,7 +53,7 @@ sub _twist {
my $family = $request->{context}; my $family = $request->{context};
my $param = $request->{parameters}; my $param = $request->{parameters};
my $abort_on_error = $request->{abort_on_error}; my $abort_on_error = $request->{abort_on_error};
my $robot_id = $family->{'robot'}; my $robot_id = $family->{'domain'};
my $path; my $path;
...@@ -271,11 +271,10 @@ sub _twist { ...@@ -271,11 +271,10 @@ sub _twist {
#FIXME: add_stat(). #FIXME: add_stat().
## Synchronize list members if required # Synchronize list members if required
if ($list->has_include_data_sources()) {
$log->syslog('notice', "Synchronizing list members..."); $log->syslog('notice', "Synchronizing list members...");
$list->sync_include(); $list->sync_include('member');
} $log->syslog('notice', "...done");
# config_changes # config_changes
if (open my $fh, '>', "$list->{'dir'}/config_changes") { if (open my $fh, '>', "$list->{'dir'}/config_changes") {
...@@ -319,11 +318,10 @@ sub _twist { ...@@ -319,11 +318,10 @@ sub _twist {
} }
} }
## Synchronize list members if required # Synchronize list members if required
if ($list->has_include_data_sources()) {
$log->syslog('notice', "Synchronizing list members..."); $log->syslog('notice', "Synchronizing list members...");
$list->sync_include(); $list->sync_include('member');
} $log->syslog('notice', "...done");
return 1; return 1;
} }
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
# Sympa - SYsteme de Multi-Postage Automatique # Sympa - SYsteme de Multi-Postage Automatique
# #
# Copyright 2017, 2018, 2019 The Sympa Community. See the AUTHORS.md file # Copyright 2017, 2018, 2019, 2020 The Sympa Community. See the AUTHORS.md
# at the top-level directory of this distribution and at # file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>. # <https://github.com/sympa-community/sympa.git>.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
...@@ -204,13 +204,7 @@ sub _twist { ...@@ -204,13 +204,7 @@ sub _twist {
unless (open $fh, '>', "$list_dir/info") { unless (open $fh, '>', "$list_dir/info") {
$log->syslog('err', 'Impossible to create %s/info: %m', $list_dir); $log->syslog('err', 'Impossible to create %s/info: %m', $list_dir);
} elsif (defined $param->{'description'}) { } elsif (defined $param->{'description'}) {
# remove DOS linefeeds (^M) that cause problems with Outlook 98, AOL, and print $fh Sympa::Tools::Text::canonic_text($param->{'description'});
# EIMS:
$param->{'description'} =~ s/\r\n|\r/\n/g;
Encode::from_to($param->{'description'},
'utf8', $Conf::Conf{'filesystem_encoding'});
print $fh $param->{'description'};
} }
close $fh; close $fh;
...@@ -264,10 +258,9 @@ sub _twist { ...@@ -264,10 +258,9 @@ sub _twist {
); );
# Synchronize list members if required # Synchronize list members if required
if ($list->has_include_data_sources()) {
$log->syslog('notice', "Synchronizing list members..."); $log->syslog('notice', "Synchronizing list members...");
$list->sync_include(); $list->sync_include('member');
} $log->syslog('notice', "...done");
$list->save_config($sender); $list->save_config($sender);
return 1; return 1;
......
This diff is collapsed.
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
# Sympa - SYsteme de Multi-Postage Automatique # Sympa - SYsteme de Multi-Postage Automatique
# #
# Copyright 2019 The Sympa Community. See the AUTHORS.md file at # Copyright 2019, 2020 The Sympa Community. See the AUTHORS.md
# the top-level directory of this distribution and at # file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>. # <https://github.com/sympa-community/sympa.git>.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
...@@ -127,10 +127,13 @@ sub _twist { ...@@ -127,10 +127,13 @@ sub _twist {
my $role = $request->{role}; my $role = $request->{role};
die 'bug in logic. Ask developer' die 'bug in logic. Ask developer'
unless grep { $role and $role eq $_ } qw(member owner editor); unless $role and grep { $role eq $_ } qw(member owner editor);
return 0
unless $list->has_data_sources($role)
or $list->has_included_users($role);
my $dss = _get_data_sources($list, $role); my $dss = _get_data_sources($list, $role);
return 0 unless $dss and @$dss;
# Get an Exclusive lock. # Get an Exclusive lock.
my $lock_file = $list->{'dir'} . '/' . $role . '.include'; my $lock_file = $list->{'dir'} . '/' . $role . '.include';
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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