diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-09-13 13:33:19 +0000 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-09-13 13:33:19 +0000 |
| commit | 970ec85cad2cc833f0ba4c9e9488952b9aa33575 (patch) | |
| tree | 51ef2401ee57f1ab447b86d14814ff359d4be5c4 /series/trunk/xmlrpc.php | |
| parent | d8bcb026d87ebd56ea57e25ba27170c8aa7fb5d1 (diff) | |
| download | instadisc-970ec85cad2cc833f0ba4c9e9488952b9aa33575.tar.gz instadisc-970ec85cad2cc833f0ba4c9e9488952b9aa33575.tar.bz2 instadisc-970ec85cad2cc833f0ba4c9e9488952b9aa33575.zip | |
Series: Integrated Update
Refs #55
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 | } |
