From cefd374290b6d0ebfa22e0af8d289e51481f6f90 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 14 Sep 2008 14:15:06 +0000 Subject: Series: Reverted Update integration Refs #55 --- series/trunk/xmlrpc.php | 66 +------------------------------------------------ 1 file changed, 1 insertion(+), 65 deletions(-) (limited to 'series/trunk/xmlrpc.php') 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) } } -function sendFromUpdate($username, $verification, $verificationID, $seriesURL, $seriesID, $title, $author, $url, $semantics, $encryptionID) -{ - if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password')) - { - $getsub = "SELECT * FROM subscriptions WHERE identity = \"" . mysql_real_escape_string($seriesID) . "\""; - $getsub2 = mysql_query($getsub); - $getsub3 = mysql_fetch_array($getsub2); - if ($getsub3['identity'] == $seriesID) - { - if ($getsub3['username'] != $username) - { - return new xmlrpcresp(new xmlrpcval('1', 'int')); - } - - $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) . "\""; - $setsub2 = mysql_query($setsub); - } else { - $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) . "\")"; - $inssub2 = mysql_query($inssub); - } - - $client = new xmlrpc_client('http://central.fourisland.com/xmlrpc.php'); - $msg = new xmlrpcmsg("InstaDisc.sendFromSeries", array( new xmlrpcval($seriesURL, 'string'), - new xmlrpcval($seriesID, 'string'), - new xmlrpcval($title, 'string'), - new xmlrpcval($author, 'string'), - new xmlrpcval($url, 'string'), - new xmlrpcval($semantics, 'string'), - new xmlrpcval($encryptionID, 'int'))); - $client->send($msg); - - return new xmlrpcresp(new xmlrpcval('0', 'int')); - } else { - return new xmlrpcresp(new xmlrpcval('2', 'int')); - } - - return new xmlrpcresp(new xmlrpcval('1', 'int')); -} - -function initSubscription($username, $verification, $verificationID, $seriesURL, $subscriptionID, $subscriptionURL, $subscriptionTitle, $subscriptionCategory, $subscriptionPersonal) -{ - if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password')) - { - $getsub = "SELECT * FROM subscriptions WHERE identity = \"" . mysql_real_escape_string($seriesID) . "\""; - $getsub2 = mysql_query($getsub); - $getsub3 = mysql_fetch_array($getsub2); - if ($getsub3['identity'] == $seriesID) - { - if ($getsub3['username'] != $username) - { - return new xmlrpcresp(new xmlrpcval('1', 'int')); - } - - $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) . "\""; - $setsub2 = mysql_query($setsub); - } else { - $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) . "\")"; - $inssub2 = mysql_query($inssub); - } - } -} - $s = new xmlrpc_server(array( "InstaDisc.subscriptionInfo" => array('function' => 'subscriptionInfo'), - "InstaDisc.getPasswordInfo" => array('function' => 'getPasswordInfo'), - "InstaDisc.sendFromUpdate" => array('function' => 'sendFromUpdate'), - "InstaDisc.initSubscription" => array('function' => 'initSubscription') + "InstaDisc.getPasswordInfo" => array('function' => 'getPasswordInfo') ), 0); $s->functions_parameters_type = 'phpvals'; $s->service(); -- cgit 1.4.1