about summary refs log tree commit diff stats
path: root/series/trunk/xmlrpc.php
diff options
context:
space:
mode:
Diffstat (limited to 'series/trunk/xmlrpc.php')
-rw-r--r--series/trunk/xmlrpc.php28
1 files changed, 26 insertions, 2 deletions
diff --git a/series/trunk/xmlrpc.php b/series/trunk/xmlrpc.php index 5756dd4..114296e 100644 --- a/series/trunk/xmlrpc.php +++ b/series/trunk/xmlrpc.php
@@ -35,7 +35,7 @@ function getPasswordInfo($id)
35 } 35 }
36} 36}
37 37
38function sendFromUpdate($username, $verification, $verificationID, $seriesURL, $seriesID, $subscriptionURL, $subscriptionTitle, $subscriptionCategory, $subscriptionPersonal, $title, $author, $url, $semantics, $encryptionID) 38function sendFromUpdate($username, $verification, $verificationID, $seriesURL, $seriesID, $title, $author, $url, $semantics, $encryptionID)
39{ 39{
40 if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password')) 40 if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password'))
41 { 41 {
@@ -74,9 +74,33 @@ function sendFromUpdate($username, $verification, $verificationID, $seriesURL, $
74 return new xmlrpcresp(new xmlrpcval('1', 'int')); 74 return new xmlrpcresp(new xmlrpcval('1', 'int'));
75} 75}
76 76
77function 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
77$s = new xmlrpc_server(array( "InstaDisc.subscriptionInfo" => array('function' => 'subscriptionInfo'), 100$s = new xmlrpc_server(array( "InstaDisc.subscriptionInfo" => array('function' => 'subscriptionInfo'),
78 "InstaDisc.getPasswordInfo" => array('function' => 'getPasswordInfo'), 101 "InstaDisc.getPasswordInfo" => array('function' => 'getPasswordInfo'),
79 "InstaDisc.sendFromUpdate" => array('function' => 'sendFromUpdate') 102 "InstaDisc.sendFromUpdate" => array('function' => 'sendFromUpdate'),
103 "InstaDisc.initSubscription" => array('function' => 'initSubscription')
80 ), 0); 104 ), 0);
81$s->functions_parameters_type = 'phpvals'; 105$s->functions_parameters_type = 'phpvals';
82$s->service(); 106$s->service();