about summary refs log tree commit diff stats
path: root/central/trunk/xmlrpc.php
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-08-01 17:12:18 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-08-01 17:12:18 +0000
commit498b6e83b649954eed35ea4197479931b7d2f1e8 (patch)
tree454997665296b20a9d5aa7dc0d29eb02d86c021a /central/trunk/xmlrpc.php
parenta8d881a7aaa9322a47023593c71aaf7994dc789e (diff)
downloadinstadisc-498b6e83b649954eed35ea4197479931b7d2f1e8.tar.gz
instadisc-498b6e83b649954eed35ea4197479931b7d2f1e8.tar.bz2
instadisc-498b6e83b649954eed35ea4197479931b7d2f1e8.zip
Central: Simplified function parameters
With the new usage of 'functions_parameters_type = "phpvals"', all parameters are stored as PHP values, and thus arrays are usable.
Diffstat (limited to 'central/trunk/xmlrpc.php')
-rw-r--r--central/trunk/xmlrpc.php51
1 files changed, 10 insertions, 41 deletions
diff --git a/central/trunk/xmlrpc.php b/central/trunk/xmlrpc.php index ec64704..1a3c1c3 100644 --- a/central/trunk/xmlrpc.php +++ b/central/trunk/xmlrpc.php
@@ -7,12 +7,8 @@ include('xmlrpc/xmlrpcs.inc');
7include('db.php'); 7include('db.php');
8include('instadisc.php'); 8include('instadisc.php');
9 9
10function checkRegistration($xmlrpcmsg) 10function checkRegistration($username, $verification, $verificationID)
11{ 11{
12 $username = $xmlrpcmsg->getParam(0)->scalarVal();
13 $verification = $xmlrpcmsg->getParam(1)->scalarVal();
14 $verificationID = $xmlrpcmsg->getParam(2)->scalarVal();
15
16 $getuser = "SELECT * FROM users WHERE username = \"" . $username "\""; 12 $getuser = "SELECT * FROM users WHERE username = \"" . $username "\"";
17 $getuser2 = mysql_query($getuser): 13 $getuser2 = mysql_query($getuser):
18 $getuser3 = mysql_fetch_array($getuser2); 14 $getuser3 = mysql_fetch_array($getuser2);
@@ -28,13 +24,8 @@ function checkRegistration($xmlrpcmsg)
28 return new xmlrpcresp(new xmlrpcval(1, "int")); 24 return new xmlrpcresp(new xmlrpcval(1, "int"));
29} 25}
30 26
31function deleteItem($xmlrpcmsg) 27function deleteItem($username, $verification, $verificationID, $id)
32{ 28{
33 $username = $xmlrpcmsg->getParam(0)->scalarVal();
34 $verification = $xmlrpcmsg->getParam(1)->scalarVal();
35 $verificationID = $xmlrpcmsg->getParam(2)->scalarVal();
36 $id = $xmlrpcmsg->getParam(3)->scalarVal();
37
38 $getuser = "SELECT * FROM users WHERE username = \"" . $username "\""; 29 $getuser = "SELECT * FROM users WHERE username = \"" . $username "\"";
39 $getuser2 = mysql_query($getuser): 30 $getuser2 = mysql_query($getuser):
40 $getuser3 = mysql_fetch_array($getuser2); 31 $getuser3 = mysql_fetch_array($getuser2);
@@ -59,13 +50,8 @@ function deleteItem($xmlrpcmsg)
59 return new xmlrpcresp(new xmlrpcval(1, "int")); 50 return new xmlrpcresp(new xmlrpcval(1, "int"));
60} 51}
61 52
62function resendItem($xmlrpcmsg) 53function resendItem($username, $verification, $verificationID, $id)
63{ 54{
64 $username = $xmlrpcmsg->getParam(0)->scalarVal();
65 $verification = $xmlrpcmsg->getParam(1)->scalarVal();
66 $verificationID = $xmlrpcmsg->getParam(2)->scalarVal();
67 $id = $xmlrpcmsg->getParam(3)->scalarVal();
68
69 $getuser = "SELECT * FROM users WHERE username = \"" . $username "\""; 55 $getuser = "SELECT * FROM users WHERE username = \"" . $username "\"";
70 $getuser2 = mysql_query($getuser): 56 $getuser2 = mysql_query($getuser):
71 $getuser3 = mysql_fetch_array($getuser2); 57 $getuser3 = mysql_fetch_array($getuser2);
@@ -89,17 +75,8 @@ function resendItem($xmlrpcmsg)
89 return new xmlrpcresp(new xmlrpcval(1, "int")); 75 return new xmlrpcresp(new xmlrpcval(1, "int"));
90} 76}
91 77
92function sendFromUpdate($xmlrpcmsg) 78function sendFromUpdate($username, $verification, $verificationID, $subscription, $title, $author, $url, $semantics)
93{ 79{
94 $username = $xmlrpcmsg->getParam(0)->scalarVal();
95 $verification = $xmlrpcmsg->getParam(1)->scalarVal();
96 $verificationID = $xmlrpcmsg->getParam(2)->scalarVal();
97 $subscription = $xmlrpcmsg->getParam(3)->scalarVal();
98 $title = $xmlrpcmsg->getParam(4)->scalarVal();
99 $author = $xmlrpcmsg->getParam(5)->scalarVal();
100 $url = $xmlrpcmsg->getParam(6)->scalarVal();
101 $semantics = deserialize($xmlrpcmsg->getParam(7)->serialize());
102
103 $getuser = "SELECT * FROM users WHERE username = \"" . $username . "\""; 80 $getuser = "SELECT * FROM users WHERE username = \"" . $username . "\"";
104 $getuser2 = mysql_query($getuser); 81 $getuser2 = mysql_query($getuser);
105 $getuser3 = mysql_fetch_array($getuser2); 82 $getuser3 = mysql_fetch_array($getuser2);
@@ -148,19 +125,8 @@ function sendFromUpdate($xmlrpcmsg)
148 return new xmlrpcresp(new xmlrpcval(1, "int")); 125 return new xmlrpcresp(new xmlrpcval(1, "int"));
149} 126}
150 127
151function sendFromCentral($xmlrpcmsg) 128function sendFromCentral($cserver, $verification, $verificationID, $subscription, $title, $author, $url, $semantics, $softwareVersion, $databaseVersion)
152{ 129{
153 $cserver = $xmlrpcmsg->getParam(0)->scalarVal();
154 $verification = $xmlrpcmsg->getParam(1)->scalarVal();
155 $verificationID = $xmlrpcmsg->getParam(2)->scalarVal();
156 $subscription = $xmlrpcmsg->getParam(3)->scalarVal();
157 $title = $xmlrpcmsg->getParam(4)->scalarVal();
158 $author = $xmlrpcmsg->getParam(5)->scalarVal();
159 $url = $xmlrpcmsg->getParam(6)->scalarVal();
160 $semantics = deserialize($xmlrpcmsg->getParam(7)->serialize());
161 $softwareVersion = $xmlrpcmsg->getParam(8)->scalarVal();
162 $databaseVersion = $xmlrpcmsg->getParam(9)->scalarVal();
163
164 $getcs = "SELECT * FROM centralServers WHERE url = \"" . $cserver . "\""; 130 $getcs = "SELECT * FROM centralServers WHERE url = \"" . $cserver . "\"";
165 $getcs2 = mysql_query($getcs); 131 $getcs2 = mysql_query($getcs);
166 $getcs3 = mysql_fetch_array($getcs2); 132 $getcs3 = mysql_fetch_array($getcs2);
@@ -225,11 +191,14 @@ function sendFromCentral($xmlrpcmsg)
225 return new xmlrpcresp(new xmlrpcval(1, "int")); 191 return new xmlrpcresp(new xmlrpcval(1, "int"));
226} 192}
227 193
228$s = new xmlrpc_server(array( "InstaDisc.checkRegistration" => array("function" => "checkRegistration"), 194$s = new xmlrpc_server( array( "InstaDisc.checkRegistration" => array("function" => "checkRegistration"),
229 "InstaDisc.deleteItem" => array("function" => "deleteItem"), 195 "InstaDisc.deleteItem" => array("function" => "deleteItem"),
230 "InstaDisc.resendItem" => array("function" => "resendItem"), 196 "InstaDisc.resendItem" => array("function" => "resendItem"),
231 "InstaDisc.requestRetained" => array("function" => "requestRetained"), 197 "InstaDisc.requestRetained" => array("function" => "requestRetained"),
232 "InstaDisc.sendFromUpdate" => array("function" => "sendFromUpdate"), 198 "InstaDisc.sendFromUpdate" => array("function" => "sendFromUpdate"),
233 "InstaDisc.sendFromCentral" => array("function" => "sendFromCentral"))); 199 "InstaDisc.sendFromCentral" => array("function" => "sendFromCentral")
200 ),0);
201$s->functions_parameters_type = 'phpvals';
202$s->service();
234 203
235?> 204?>