summaryrefslogtreecommitdiff
path: root/bin/xmlrpc-edit_contact
blob: 574284bbce201014cb5b1fb244dbd5070d4601bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/perl

use strict;
use Frontier::Client;
use Data::Dumper;

my( $email, $password, $new_email ) = @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' => $password,
);
die $login_result->{'error'}."\n" if $login_result->{'error'};

my $passwd_result = $server->call(
  'FS.ClientAPI_XMLRPC.edit_contact',
    'session_id'   => $login_result->{'session_id'},
    'emailaddress' => $new_email,
);
die $passwd_result->{'error'}."\n" if $passwd_result->{'error'};

warn "Email changed.\n";

1;