diff options
Diffstat (limited to 'series/trunk/xmlrpc.php')
-rw-r--r-- | series/trunk/xmlrpc.php | 66 |
1 files changed, 1 insertions, 65 deletions
diff --git a/series/trunk/xmlrpc.php b/series/trunk/xmlrpc.php index 114296e..01664ad 100644 --- a/series/trunk/xmlrpc.php +++ b/series/trunk/xmlrpc.php | |||
@@ -35,72 +35,8 @@ function getPasswordInfo($id) | |||
35 | } | 35 | } |
36 | } | 36 | } |
37 | 37 | ||
38 | function sendFromUpdate($username, $verification, $verificationID, $seriesURL, $seriesID, $title, $author, $url, $semantics, $encryptionID) | ||
39 | { | ||
40 | if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password')) | ||
41 | { | ||
42 | $getsub = "SELECT * FROM subscriptions WHERE identity = \"" . mysql_real_escape_string($seriesID) . "\""; | ||
43 | $getsub2 = mysql_query($getsub); | ||
44 | $getsub3 = mysql_fetch_array($getsub2); | ||
45 | if ($getsub3['identity'] == $seriesID) | ||
46 | { | ||
47 | if ($getsub3['username'] != $username) | ||
48 | { | ||
49 | return new xmlrpcresp(new xmlrpcval('1', 'int')); | ||
50 | } | ||
51 | |||
52 | $setsub = "UPDATE subscriptions SET title = \"" . mysql_real_escape_string($subscriptionTitle) . "\", url = \"" . mysql_real_escape_string($subscriptionURL) . "\", category = \"" . mysql_real_escape_string($subscriptionCategory) . "\", personal = \"" . mysql_real_escape_string($subscriptionPersonal) . "\""; | ||
53 | $setsub2 = mysql_query($setsub); | ||
54 | } else { | ||
55 | $inssub = "INSERT INTO subscriptions (identity, title, url, category, personal, username) VALUES (\"" . mysql_real_escape_string($seriesID) . "\",\"" . mysql_real_escape_string($subscriptionTitle) . "\",\"" . mysql_real_escape_string($subscriptionURL) . "\",\"" . mysql_real_escape_string($subscriptionCategory) . "\",\"" . mysql_real_escape_string($subscriptionPersonal) . "\",\"" . mysql_real_escape_string($username) . "\")"; | ||
56 | $inssub2 = mysql_query($inssub); | ||
57 | } | ||
58 | |||
59 | $client = new xmlrpc_client('http://central.fourisland.com/xmlrpc.php'); | ||
60 | $msg = new xmlrpcmsg("InstaDisc.sendFromSeries", array( new xmlrpcval($seriesURL, 'string'), | ||
61 | new xmlrpcval($seriesID, 'string'), | ||
62 | new xmlrpcval($title, 'string'), | ||
63 | new xmlrpcval($author, 'string'), | ||
64 | new xmlrpcval($url, 'string'), | ||
65 | new xmlrpcval($semantics, 'string'), | ||
66 | new xmlrpcval($encryptionID, 'int'))); | ||
67 | $client->send($msg); | ||
68 | |||
69 | return new xmlrpcresp(new xmlrpcval('0', 'int')); | ||
70 | } else { | ||
71 | return new xmlrpcresp(new xmlrpcval('2', 'int')); | ||
72 | } | ||
73 | |||
74 | return new xmlrpcresp(new xmlrpcval('1', 'int')); | ||
75 | } | ||
76 | |||
77 | function initSubscription($username, $verification, $verificationID, $seriesURL, $subscriptionID, $subscriptionURL, $subscriptionTitle, $subscriptionCategory, $subscriptionPersonal) | ||
78 | { | ||
79 | if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password')) | ||
80 | { | ||
81 | $getsub = "SELECT * FROM subscriptions WHERE identity = \"" . mysql_real_escape_string($seriesID) . "\""; | ||
82 | $getsub2 = mysql_query($getsub); | ||
83 | $getsub3 = mysql_fetch_array($getsub2); | ||
84 | if ($getsub3['identity'] == $seriesID) | ||
85 | { | ||
86 | if ($getsub3['username'] != $username) | ||
87 | { | ||
88 | return new xmlrpcresp(new xmlrpcval('1', 'int')); | ||
89 | } | ||
90 | |||
91 | $setsub = "UPDATE subscriptions SET title = \"" . mysql_real_escape_string($subscriptionTitle) . "\", url = \"" . mysql_real_escape_string($subscriptionURL) . "\", category = \"" . mysql_real_escape_string($subscriptionCategory) . "\", personal = \"" . mysql_real_escape_string($subscriptionPersonal) . "\""; | ||
92 | $setsub2 = mysql_query($setsub); | ||
93 | } else { | ||
94 | $inssub = "INSERT INTO subscriptions (identity, title, url, category, personal, username) VALUES (\"" . mysql_real_escape_string($seriesID) . "\",\"" . mysql_real_escape_string($subscriptionTitle) . "\",\"" . mysql_real_escape_string($subscriptionURL) . "\",\"" . mysql_real_escape_string($subscriptionCategory) . "\",\"" . mysql_real_escape_string($subscriptionPersonal) . "\",\"" . mysql_real_escape_string($username) . "\")"; | ||
95 | $inssub2 = mysql_query($inssub); | ||
96 | } | ||
97 | } | ||
98 | } | ||
99 | |||
100 | $s = new xmlrpc_server(array( "InstaDisc.subscriptionInfo" => array('function' => 'subscriptionInfo'), | 38 | $s = new xmlrpc_server(array( "InstaDisc.subscriptionInfo" => array('function' => 'subscriptionInfo'), |
101 | "InstaDisc.getPasswordInfo" => array('function' => 'getPasswordInfo'), | 39 | "InstaDisc.getPasswordInfo" => array('function' => 'getPasswordInfo') |
102 | "InstaDisc.sendFromUpdate" => array('function' => 'sendFromUpdate'), | ||
103 | "InstaDisc.initSubscription" => array('function' => 'initSubscription') | ||
104 | ), 0); | 40 | ), 0); |
105 | $s->functions_parameters_type = 'phpvals'; | 41 | $s->functions_parameters_type = 'phpvals'; |
106 | $s->service(); | 42 | $s->service(); |