X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fjson_export.pl;fp=cmd%2Fjson_export.pl;h=06dbda69edb075eaea64ff11a8fa021383ecd0db;hb=cb8e8a033f5960ca5854e89c68be461dd70cbd47;hp=0000000000000000000000000000000000000000;hpb=07f2fed2f2949fb9e3f7f86c208150841bdeb30f;p=spider.git diff --git a/cmd/json_export.pl b/cmd/json_export.pl new file mode 100644 index 00000000..06dbda69 --- /dev/null +++ b/cmd/json_export.pl @@ -0,0 +1,22 @@ +# +# the export the user file to ascii command +# +# +# +my $self = shift; +my $line = shift;; +return (1, $self->msg('e5')) unless $self->priv >= 9; + +my ($fn, $flag) = split /\s+/, $line; +$fn ||= 'user_json'; +unless ($fn && $fn eq 'user_json') { + $fn =~ s|[/\.]||g; + $fn = "/tmp/$fn"; +} +my $strip = $flag eq 'strip'; + +my @out = DXUser::export_json($fn, $strip); + +return (1, @out); + +