diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-07-20 19:09:54 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-20 19:09:54 -0700 |
commit | 8f809c417ee15614307901a8040e41aeb72cf78c (patch) | |
tree | e423e5569847c3ce7e046ef8d51b257bd377e460 /bin/xmlrpc-contact_passwd | |
parent | afb9c277f6755444adbcc9bd4681c4d089e74681 (diff) |
contact self-service pw changes, RT#37023
Diffstat (limited to 'bin/xmlrpc-contact_passwd')
-rwxr-xr-x | bin/xmlrpc-contact_passwd | 29 |
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; |