summaryrefslogtreecommitdiff
path: root/bin/xmlrpc-contact_passwd
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-07-26 15:41:26 -0700
committerIvan Kohler <ivan@freeside.biz>2015-07-26 15:41:26 -0700
commit9aee669886202be7035e6c6049fc71bc99dd3013 (patch)
tree2fd5bf6de74f3d99270587ffb1833e4188a6373d /bin/xmlrpc-contact_passwd
parentac20214d38d9af00430423f147b5a0e50751b050 (diff)
parent1add633372bdca3cc7163c2ce48363fed3984437 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'bin/xmlrpc-contact_passwd')
-rwxr-xr-xbin/xmlrpc-contact_passwd29
1 files changed, 29 insertions, 0 deletions
diff --git a/bin/xmlrpc-contact_passwd b/bin/xmlrpc-contact_passwd
new file mode 100755
index 000000000..1a89d4260
--- /dev/null
+++ b/bin/xmlrpc-contact_passwd
@@ -0,0 +1,29 @@
+#!/usr/bin/perl
+
+use strict;
+use Frontier::Client;
+use Data::Dumper;
+
+my( $email, $current_pw, $new_pw ) = @ARGV;
+
+my $uri = new URI 'http://localhost:8080/';
+
+my $server = new Frontier::Client ( 'url' => $uri );
+
+my $login_result = $server->call(
+ 'FS.ClientAPI_XMLRPC.login',
+ 'email' => $email,
+ 'password' => $current_pw,
+);
+die $login_result->{'error'}."\n" if $login_result->{'error'};
+
+my $passwd_result = $server->call(
+ 'FS.ClientAPI_XMLRPC.contact_passwd',
+ 'session_id' => $login_result->{'session_id'},
+ 'new_password' => $new_pw,
+);
+die $passwd_result->{'error'}."\n" if $passwd_result->{'error'};
+
+warn "Password changed.\n";
+
+1;