diff options
Diffstat (limited to 'central/trunk/xmlrpc.php')
-rw-r--r-- | central/trunk/xmlrpc.php | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/central/trunk/xmlrpc.php b/central/trunk/xmlrpc.php index 64dc4f7..48f1e5e 100644 --- a/central/trunk/xmlrpc.php +++ b/central/trunk/xmlrpc.php | |||
@@ -79,36 +79,39 @@ function sendFromUpdate($username, $verification, $verificationID, $subscription | |||
79 | { | 79 | { |
80 | if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password')) | 80 | if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password')) |
81 | { | 81 | { |
82 | $cserver = $_SERVER['SERVER_NAME']; | 82 | if (instaDisc_resolveSubscription($subscriptionSeriesURL, $subscriptionID) != 'false') |
83 | $getuk = "SELECT * FROM centralServers WHERE url = \"" . mysql_real_escape_string($cserver) . "\""; | ||
84 | $getuk2 = mysql_query($getuk); | ||
85 | $getuk3 = mysql_fetch_array($getuk2); | ||
86 | |||
87 | $getcs = "SELECT * FROM centralServers"; | ||
88 | $getcs2 = mysql_query($getcs); | ||
89 | $i=0; | ||
90 | while ($getcs3[$i] = mysql_fetch_array($getcs2)) | ||
91 | { | 83 | { |
92 | $verID = rand(1,2147483647); | 84 | $cserver = $_SERVER['SERVER_NAME']; |
85 | $getuk = "SELECT * FROM centralServers WHERE url = \"" . mysql_real_escape_string($cserver) . "\""; | ||
86 | $getuk2 = mysql_query($getuk); | ||
87 | $getuk3 = mysql_fetch_array($getuk2); | ||
93 | 88 | ||
94 | $client = new xmlrpc_client($getcs3[$i]['xmlrpc']); | 89 | $getcs = "SELECT * FROM centralServers"; |
95 | $msg = new xmlrpcmsg("InstaDisc.sendFromCentral", array( new xmlrpcval($cserver, 'string'), | 90 | $getcs2 = mysql_query($getcs); |
96 | new xmlrpcval(md5($cserver . ":" . $getuk3['code'] . ":" . $verID), 'string'), | 91 | $i=0; |
97 | new xmlrpcval($verID, 'int'), | 92 | while ($getcs3[$i] = mysql_fetch_array($getcs2)) |
98 | new xmlrpcval($subscriptionSeriesURL, 'string'), | 93 | { |
99 | new xmlrpcval($subscriptionID, 'string'), | 94 | $verID = rand(1,2147483647); |
100 | new xmlrpcval($title, 'string'), | 95 | |
101 | new xmlrpcval($author, 'string'), | 96 | $client = new xmlrpc_client($getcs3[$i]['xmlrpc']); |
102 | new xmlrpcval($url, 'string'), | 97 | $msg = new xmlrpcmsg("InstaDisc.sendFromCentral", array( new xmlrpcval($cserver, 'string'), |
103 | new xmlrpcval($semantics, 'string'), | 98 | new xmlrpcval(md5($cserver . ":" . $getuk3['code'] . ":" . $verID), 'string'), |
104 | new xmlrpcval($encryptionID, 'int'), | 99 | new xmlrpcval($verID, 'int'), |
105 | new xmlrpcval(instaDisc_getConfig('softwareVersion'), 'int'), | 100 | new xmlrpcval($subscriptionSeriesURL, 'string'), |
106 | new xmlrpcval(instaDisc_getConfig('databaseVersion'), 'int'))); | 101 | new xmlrpcval($subscriptionID, 'string'), |
107 | $client->send($msg); | 102 | new xmlrpcval($title, 'string'), |
108 | $i++; | 103 | new xmlrpcval($author, 'string'), |
109 | } | 104 | new xmlrpcval($url, 'string'), |
105 | new xmlrpcval($semantics, 'string'), | ||
106 | new xmlrpcval($encryptionID, 'int'), | ||
107 | new xmlrpcval(instaDisc_getConfig('softwareVersion'), 'int'), | ||
108 | new xmlrpcval(instaDisc_getConfig('databaseVersion'), 'int'))); | ||
109 | $client->send($msg); | ||
110 | $i++; | ||
111 | } | ||
110 | 112 | ||
111 | return new xmlrpcresp(new xmlrpcval(0, "int")); | 113 | return new xmlrpcresp(new xmlrpcval(0, "int")); |
114 | } | ||
112 | } else { | 115 | } else { |
113 | return new xmlrpcresp(new xmlrpcval(2, "int")); | 116 | return new xmlrpcresp(new xmlrpcval(2, "int")); |
114 | } | 117 | } |