diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-09-13 16:02:31 +0000 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-09-13 16:02:31 +0000 |
commit | 1ad668d889d1d8a5da93c25591793f5b2ccde121 (patch) | |
tree | b455fd04c582b3a6103e0e955361bac433bd2f4c /series/trunk | |
parent | e22d0258ab3be779f78c17c6567c4205226e7399 (diff) | |
download | instadisc-1ad668d889d1d8a5da93c25591793f5b2ccde121.tar.gz instadisc-1ad668d889d1d8a5da93c25591793f5b2ccde121.tar.bz2 instadisc-1ad668d889d1d8a5da93c25591793f5b2ccde121.zip |
Series: Added initSubscription()
Refs #55
Diffstat (limited to 'series/trunk')
-rw-r--r-- | series/trunk/xmlrpc.php | 28 |
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 | ||
38 | function sendFromUpdate($username, $verification, $verificationID, $seriesURL, $seriesID, $subscriptionURL, $subscriptionTitle, $subscriptionCategory, $subscriptionPersonal, $title, $author, $url, $semantics, $encryptionID) | 38 | function 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 | ||
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 | |||
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(); |