about summary refs log tree commit diff stats
path: root/series/core
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-09-07 13:33:30 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-09-07 13:33:30 +0000
commit866a1d8567457b451d61339064b52973419b2b0b (patch)
tree45d2a14413992baaf4b43d6e31dd54143a8ff937 /series/core
parent3f432ba4762dde5de489b38dffe3d00a043cc006 (diff)
downloadinstadisc-866a1d8567457b451d61339064b52973419b2b0b.tar.gz
instadisc-866a1d8567457b451d61339064b52973419b2b0b.tar.bz2
instadisc-866a1d8567457b451d61339064b52973419b2b0b.zip
Series: Added getPasswordInfo() to XML-RPC interface
Refs #28
Diffstat (limited to 'series/core')
-rw-r--r--series/core/trunk/xmlrpc.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/series/core/trunk/xmlrpc.php b/series/core/trunk/xmlrpc.php index 60ada6a..01664ad 100644 --- a/series/core/trunk/xmlrpc.php +++ b/series/core/trunk/xmlrpc.php
@@ -17,7 +17,26 @@ function subscriptionInfo($id)
17 )); 17 ));
18} 18}
19 19
20$s = new xmlrpc_server(array( "InstaDisc.subscriptionInfo" => array('function' => 'subscriptionInfo') 20function getPasswordInfo($id)
21{
22 if (!instaDisc_subscriptionExists($id))
23 {
24 return new xmlrpcresp(new xmlrpcval('false', 'string'));
25 }
26
27 $sub = instaDisc_getSubscription($id);
28 if ($sub['password'] == '')
29 {
30 return new xmlrpcresp(new xmlrpcval('false', 'string'));
31 } else {
32 $verID = rand(1,2147483647);
33
34 return new xmlrpcresp(new xmlrpcval(md5($sub['password'] . ':' . $verID) . ':' . $verID, 'string'));
35 }
36}
37
38$s = new xmlrpc_server(array( "InstaDisc.subscriptionInfo" => array('function' => 'subscriptionInfo'),
39 "InstaDisc.getPasswordInfo" => array('function' => 'getPasswordInfo')
21 ), 0); 40 ), 0);
22$s->functions_parameters_type = 'phpvals'; 41$s->functions_parameters_type = 'phpvals';
23$s->service(); 42$s->service();