diff options
Diffstat (limited to 'series/trunk/xmlrpc.php')
-rw-r--r-- | series/trunk/xmlrpc.php | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/series/trunk/xmlrpc.php b/series/trunk/xmlrpc.php index 9024ae2..7bb7f10 100644 --- a/series/trunk/xmlrpc.php +++ b/series/trunk/xmlrpc.php | |||
@@ -39,7 +39,34 @@ function sendFromUpdate($username, $verification, $verificationID, $seriesURL, $ | |||
39 | { | 39 | { |
40 | if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password')) | 40 | if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password')) |
41 | { | 41 | { |
42 | 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 = 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')); | ||
43 | } else { | 70 | } else { |
44 | return new xmlrpcresp(new xmlrpcval('2', 'int')); | 71 | return new xmlrpcresp(new xmlrpcval('2', 'int')); |
45 | } | 72 | } |