X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fexport_users.pl;h=62429ffebf2d2bcf7123dd727b036ac7b48d5b29;hb=deb52e701a0db351d06eb6fe14872dc2fa7a51cb;hp=4c143ebbf43c80776bff8e65e616513f64f52057;hpb=6c38bca91e6b75002e15cce29c45a894f675e22e;p=spider.git diff --git a/cmd/export_users.pl b/cmd/export_users.pl index 4c143ebb..62429ffe 100644 --- a/cmd/export_users.pl +++ b/cmd/export_users.pl @@ -1,9 +1,22 @@ # # the export the user file to ascii command # -# $Id$ +# # my $self = shift; +my $line = shift;; return (1, $self->msg('e5')) unless $self->priv >= 9; -my $line = shift || "$main::data/user_asc"; -return (1, DXUser::export($line)); + +$line ||= 'user_json'; +my ($fn, $flag) = split /\s+/, $line; +unless ($fn && $fn eq 'user_json') { + $fn =~ s|[/\.]||g; + $fn = "/tmp/$fn"; +} +my $strip = $flag && $flag eq 'strip'; + +my @out = DXUser::export($fn, $strip); + +return (1, @out); + +