Index: server/trunk/admin/bin/sophie_admin
===================================================================
--- server/trunk/admin/bin/sophie_admin	(revision 247)
+++ server/trunk/admin/bin/sophie_admin	(revision 248)
@@ -5,4 +5,5 @@
 require RPC::XML::Client;
 use Getopt::Long;
+use Term::ReadKey;
 
 GetOptions(
@@ -10,8 +11,14 @@
 ) or die "Wrong options";
 
-require Data::Dumper;
-my $xmlcli = RPC::XML::Client->new($server || 'http://127.0.0.1:3000/rpc');
+ReadMode('noecho');
+print "Enter password: ";
+my $password = ReadLine(0);
+ReadMode 0;
+print "\n";
+chomp($password);
 
-my $res = $xmlcli->send_request('login', 'admin', 'toto');
+my $xmlcli = RPC::XML::Client->new($server || 'http://sophie.zarb.org/rpc');
+
+my $res = $xmlcli->send_request('login', 'admin', $password);
 if (ref $res) {
     $xmlcli->request->header('cookie', $$res);
Index: server/trunk/admin/bin/sophie_dump
===================================================================
--- server/trunk/admin/bin/sophie_dump	(revision 248)
+++ server/trunk/admin/bin/sophie_dump	(revision 248)
@@ -0,0 +1,42 @@
+#!/bin/env perl
+
+use Sophie::Cli;
+require RPC::XML;
+require RPC::XML::Client;
+use Term::ReadKey;
+use Getopt::Long;
+
+GetOptions(
+    'o=s' => \my $file,
+    's=s' => \my $server,
+);
+
+ReadMode('noecho');
+print "Enter password: ";
+my $password = ReadLine(0);
+ReadMode 0;
+print "\n";
+chomp($password);
+
+require Data::Dumper;
+my $xmlcli = RPC::XML::Client->new($server || 'http://sophie.zarb.org/rpc');
+
+my $res = $xmlcli->send_request('login', 'admin', $password);
+if (ref $res) {
+    $xmlcli->request->header('cookie', $$res);
+} else {
+    die "Can't login";
+}
+
+my $res = $xmlcli->send_request('admin.dump_distrib', @ARGV);
+if (!ref $res || $res->is_fault) {
+    die (ref $res ? $res->string : $res) . "\n";
+}
+
+if ($file) {
+    open(my $handle, '>', $file) or die "Can't open file $!";
+    print $handle $res->value;
+    close($handle);
+} else {
+    print $res->value;
+}
Index: server/trunk/admin/bin/sophie_load
===================================================================
--- server/trunk/admin/bin/sophie_load	(revision 248)
+++ server/trunk/admin/bin/sophie_load	(revision 248)
@@ -0,0 +1,41 @@
+#!/bin/env perl
+
+use Sophie::Cli;
+require RPC::XML;
+require RPC::XML::Client;
+use Term::ReadKey;
+use Getopt::Long;
+
+GetOptions(
+        'f=s' => \my $file,
+        's=s' => \my $server,
+);
+
+ReadMode('noecho');
+print "Enter password: ";
+my $password = ReadLine(0);
+ReadMode 0;
+print "\n";
+chomp($password);
+
+require Data::Dumper;
+my $xmlcli = RPC::XML::Client->new($server || 'http://sophie.zarb.org/rpc');
+
+my $res = $xmlcli->send_request('login', 'admin', $password);
+if (ref $res) {
+    $xmlcli->request->header('cookie', $$res);
+} else {
+    die "Can't login";
+}
+
+my $string;
+if (my $file) {
+    open($handle, '<', $file) || die "can't open file $!";
+    $string = join('', <$handle>);
+    close($handle);
+} else {
+    $string = join('', <STDIN>);
+}
+
+my $res = $xmlcli->send_request('admin.load_distrib', $string);
+print $res->value;
Index: server/trunk/admin/lib/Sophie/Cli.pm
===================================================================
--- server/trunk/admin/lib/Sophie/Cli.pm	(revision 247)
+++ server/trunk/admin/lib/Sophie/Cli.pm	(revision 248)
@@ -192,4 +192,52 @@
     my $env = __PACKAGE__->new({}, $base);
 
+    $env->add_func('list_user',
+        {
+            code => sub {
+                my ($self, $match) = @_;
+                my $res = $self->xmlreq('admin.list_user', $match);
+                if ($res) {
+                    print $OUT (map { "$_\n" } @{ $res->value });
+                }
+            }
+        }
+    );
+    $env->add_func('delete_user',
+        {
+            code => sub {
+                my ($self, $match) = @_;
+                my $res = $self->xmlreq('admin.delete_user', $match);
+                if ($res) {
+                    print $OUT $res->value . "\n";
+                }
+            },
+            completion => sub {
+                my ($self, undef, @args) = @_;
+                my $res = $self->xmlreq(
+                    'admin.list_user');
+                return @{$res->value};
+            },
+        }
+    );
+    $env->add_func('set_password',
+        {
+            code => sub {
+                my ($self, $match, $password) = @_;
+                my $res = $self->xmlreq('admin.set_user_password', $match,
+                    $password);
+                if ($res) {
+                    print $OUT $res->value . "\n";
+                }
+            },
+            completion => sub {
+                my ($self, undef, $user) = @_;
+                if (!$user) {
+                my $res = $self->xmlreq(
+                    'admin.list_user');
+                return @{$res->value};
+                } else { return }
+            },
+        }
+    );
     $env->add_func('create_user',
         {
@@ -217,5 +265,5 @@
                 my $res = $self->xmlreq(
                     'distrib.list', @args);
-                return  map { $_ } @{$res->value};
+                return @{$res->value};
             },
         },
