add first part of json users file change
[spider.git] / cmd / json_export.pl
diff --git a/cmd/json_export.pl b/cmd/json_export.pl
new file mode 100644 (file)
index 0000000..06dbda6
--- /dev/null
@@ -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);
+
+