RT# 82137 - default payment amount now has processing fee in total if processing...
[freeside.git] / bin / xmlrpc-contact_passwd
1 #!/usr/bin/perl
2
3 use strict;
4 use Frontier::Client;
5 use Data::Dumper;
6
7 my( $email, $current_pw, $new_pw ) = @ARGV;
8
9 my $uri = new URI 'http://localhost:8080/';
10
11 my $server = new Frontier::Client ( 'url' => $uri );
12
13 my $login_result = $server->call(
14   'FS.ClientAPI_XMLRPC.login',
15     'email'    => $email,
16     'password' => $current_pw,
17 );
18 die $login_result->{'error'}."\n" if $login_result->{'error'};
19
20 my $passwd_result = $server->call(
21   'FS.ClientAPI_XMLRPC.contact_passwd',
22     'session_id'   => $login_result->{'session_id'},
23     'new_password' => $new_pw,
24 );
25 die $passwd_result->{'error'}."\n" if $passwd_result->{'error'};
26
27 warn "Password changed.\n";
28
29 1;