about summary refs log tree commit diff stats
path: root/series/trunk/xmlrpc.php
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-09-10 21:06:49 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-09-10 21:06:49 +0000
commit44c3bc48b5db7b3dc6517d2b073a55af5d4b52db (patch)
treea48f63061f3cfe5427ce1bc313147cf6be0e739a /series/trunk/xmlrpc.php
parenta9a796498285358e7a2f1fde5043e4015de5db70 (diff)
downloadinstadisc-44c3bc48b5db7b3dc6517d2b073a55af5d4b52db.tar.gz
instadisc-44c3bc48b5db7b3dc6517d2b073a55af5d4b52db.tar.bz2
instadisc-44c3bc48b5db7b3dc6517d2b073a55af5d4b52db.zip
Series: Moved around directory structure
Refs #55
Diffstat (limited to 'series/trunk/xmlrpc.php')
-rw-r--r--series/trunk/xmlrpc.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/series/trunk/xmlrpc.php b/series/trunk/xmlrpc.php new file mode 100644 index 0000000..01664ad --- /dev/null +++ b/series/trunk/xmlrpc.php
@@ -0,0 +1,44 @@
1<?php
2
3/* InstaDisc Series - A Four Project */
4
5include('includes/instadisc.php');
6
7function subscriptionInfo($id)
8{
9 if (!instaDisc_subscriptionExists($id))
10 {
11 return new xmlrpcresp(new xmlrpcval('false', 'string'));
12 }
13
14 $sub = instaDisc_getSubscription($id);
15 return serialize(array( 'url' => $sub['url'],
16 'category' => $sub['category']
17 ));
18}
19
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')
40 ), 0);
41$s->functions_parameters_type = 'phpvals';
42$s->service();
43
44?>