diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-09-07 13:33:30 +0000 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-09-07 13:33:30 +0000 |
commit | 866a1d8567457b451d61339064b52973419b2b0b (patch) | |
tree | 45d2a14413992baaf4b43d6e31dd54143a8ff937 | |
parent | 3f432ba4762dde5de489b38dffe3d00a043cc006 (diff) | |
download | instadisc-866a1d8567457b451d61339064b52973419b2b0b.tar.gz instadisc-866a1d8567457b451d61339064b52973419b2b0b.tar.bz2 instadisc-866a1d8567457b451d61339064b52973419b2b0b.zip |
Series: Added getPasswordInfo() to XML-RPC interface
Refs #28
-rw-r--r-- | series/core/trunk/xmlrpc.php | 21 |
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') | 20 | function 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(); |