Commit 371a0fa0 authored by IKEDA Soji's avatar IKEDA Soji
Browse files

Lost owners/moderators by "Copy list" action

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