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

Merge pull request #385 from ikedas/issue-384 by ikedas

Lost owners/moderators by "Copy list" action
parents edf77eca 371a0fa0
......@@ -524,6 +524,11 @@ sub _copy {
$self->add_stash($request, 'intern');
return undef;
}
# Dump permanent/transitional owners and moderators (Not subscribers).
$current_list->dump_users('owner');
$current_list->dump_users('editor');
chmod 0775, $new_dir;
foreach my $subdir ('etc', 'web_tt2', 'mail_tt2', 'data_sources') {
if (-d $new_dir . '/' . $subdir) {
......@@ -544,7 +549,7 @@ sub _copy {
}
}
# copy mandatory files
foreach my $file ('config') {
foreach my $file ('config', 'owner.dump', 'editor.dump') {
unless (
File::Copy::copy(
$current_list->{'dir'} . '/' . $file,
......@@ -584,7 +589,7 @@ sub _copy {
my $new_list;
# Now switch List object to new list, update some values.
unless ($new_list =
Sympa::List->new($listname, $robot_id, {'reload_config' => 1})) {
Sympa::List->new($listname, $robot_id, {skip_sync_admin => 1})) {
$log->syslog('info', 'Unable to load %s while renamming', $listname);
$self->add_stash($request, 'intern');
return undef;
......@@ -600,6 +605,10 @@ sub _copy {
_modify_custom_subject($request, $new_list);
$new_list->save_config($sender);
# Store permanent/transitional owners and moderators (Not subscribers).
$new_list->restore_users('owner');
$new_list->restore_users('editor');
return 1;
}
......
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