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

Merge pull request #645 from ldidry/fix-637 by ldidry

Allow to activate pending lists with sympa.pl
parents e89e1c13 e6be4989
...@@ -87,7 +87,7 @@ unless ( ...@@ -87,7 +87,7 @@ unless (
'send_digest', 'keep_digest', 'send_digest', 'keep_digest',
'upgrade_config_location', 'role=s', 'upgrade_config_location', 'role=s',
'dump_users', 'restore_users', 'dump_users', 'restore_users',
'open_list=s', 'open_list=s', 'show_pending_lists=s'
) )
) { ) {
pod2usage(-exitval => 1, -output => \*STDERR); pod2usage(-exitval => 1, -output => \*STDERR);
...@@ -1066,9 +1066,13 @@ elsif ($main::options{'sync_list_db'}) { ...@@ -1066,9 +1066,13 @@ elsif ($main::options{'sync_list_db'}) {
exit 1; exit 1;
} }
my $mode = 'open';
$mode = 'install' if $current_list->{'admin'}{'status'} eq 'pending';
my $spindle = Sympa::Spindle::ProcessRequest->new( my $spindle = Sympa::Spindle::ProcessRequest->new(
context => $robot_id, context => $robot_id,
action => 'open_list', action => 'open_list',
mode => $mode,
current_list => $current_list, current_list => $current_list,
sender => Sympa::get_address($robot_id, 'listmaster'), sender => Sympa::get_address($robot_id, 'listmaster'),
scenario_context => {skip => 1}, scenario_context => {skip => 1},
...@@ -1078,6 +1082,27 @@ elsif ($main::options{'sync_list_db'}) { ...@@ -1078,6 +1082,27 @@ elsif ($main::options{'sync_list_db'}) {
exit 1; exit 1;
} }
exit 0; exit 0;
} elsif ($main::options{'show_pending_lists'}) {
my $all_lists = Sympa::List::get_lists(
$main::options{'show_pending_lists'},
'filter' => ['status' => 'pending']
);
if (@{$all_lists}) {
print "Pending lists:\n";
foreach my $list (@$all_lists) {
printf "%s@%s\n subject: %s\n creator: %s\n date: %s\n",
$list->{'name'},
$main::options{'show_pending_lists'},
$list->{'admin'}{'subject'},
$list->{'admin'}{'creation'}{'email'},
$list->{'admin'}{'creation'}{'date_epoch'};
}
} else {
printf "No pending list for robot %s\n",
$main::options{'show_pending_lists'};
}
exit 0;
} }
die 'Unknown option'; die 'Unknown option';
...@@ -1253,6 +1278,7 @@ S<[ C<--purge_list>=I<list>[I<@robot>] ]> ...@@ -1253,6 +1278,7 @@ S<[ C<--purge_list>=I<list>[I<@robot>] ]>
S<[ C<--lowercase> ]> S<[ C<--make_alias_file> ]> S<[ C<--lowercase> ]> S<[ C<--make_alias_file> ]>
S<[ C<--dump_users> C<--list>=I<list>@I<domain>|ALL [ C<--role>=I<roles> ] ]> S<[ C<--dump_users> C<--list>=I<list>@I<domain>|ALL [ C<--role>=I<roles> ] ]>
S<[ C<--restore_users> C<--list>=I<list>@I<domain>|ALL [ C<--role>=I<roles> ] ]> S<[ C<--restore_users> C<--list>=I<list>@I<domain>|ALL [ C<--role>=I<roles> ] ]>
S<[ C<--show_pending_lists>=I<robot> ]>
=head1 DESCRIPTION =head1 DESCRIPTION
...@@ -1415,6 +1441,10 @@ users to DB (dump files in the list directory are imported). ...@@ -1415,6 +1441,10 @@ users to DB (dump files in the list directory are imported).
Remove the list (remove archive, configuration files, users and owners in admin table. Restore is not possible after this operation. Remove the list (remove archive, configuration files, users and owners in admin table. Restore is not possible after this operation.
=item C<--show_pending_lists>=I<robot>
Print all pending lists for the robot, with informations.
=item C<--reload_list_config> =item C<--reload_list_config>
[ C<--list=>I<mylist>@I<mydom> ] [ C<--robot=>I<mydom> ] [ C<--list=>I<mylist>@I<mydom> ] [ C<--robot=>I<mydom> ]
......
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