diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-04 12:12:25 +0000 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-04 12:12:25 +0000 |
commit | 0df0e5f1e927ea1d04bd5ef3c12be3bc2c72837c (patch) | |
tree | 81f557ea530b0748fe5b48fdde961e4d459b0151 /central/trunk/xmlrpc.php | |
parent | 96969d7023cf8703bf9c460e1d54d4e32a076987 (diff) | |
download | instadisc-0df0e5f1e927ea1d04bd5ef3c12be3bc2c72837c.tar.gz instadisc-0df0e5f1e927ea1d04bd5ef3c12be3bc2c72837c.tar.bz2 instadisc-0df0e5f1e927ea1d04bd5ef3c12be3bc2c72837c.zip |
Central: Wrote installation script
Closes #4
Diffstat (limited to 'central/trunk/xmlrpc.php')
-rw-r--r-- | central/trunk/xmlrpc.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/central/trunk/xmlrpc.php b/central/trunk/xmlrpc.php index 5377a3b..efaa70f 100644 --- a/central/trunk/xmlrpc.php +++ b/central/trunk/xmlrpc.php | |||
@@ -96,7 +96,7 @@ function sendFromUpdate($username, $verification, $verificationID, $subscription | |||
96 | 96 | ||
97 | $client = new xmlrpc_client($getcs3[$i]['xmlrpc']); | 97 | $client = new xmlrpc_client($getcs3[$i]['xmlrpc']); |
98 | $msg = new xmlrpcmsg("InstaDisc.sendFromCentral", array( new xmlrpcval($cserver, 'string'), | 98 | $msg = new xmlrpcmsg("InstaDisc.sendFromCentral", array( new xmlrpcval($cserver, 'string'), |
99 | new xmlrpcval(md5($cserver + ":" + $getuk3['key'] + ":" + $verID), 'string'), | 99 | new xmlrpcval(md5($cserver + ":" + $getuk3['code'] + ":" + $verID), 'string'), |
100 | new xmlrpcval($verID, 'int'), | 100 | new xmlrpcval($verID, 'int'), |
101 | new xmlrpcval($subscription, 'string'), | 101 | new xmlrpcval($subscription, 'string'), |
102 | new xmlrpcval($title, 'string'), | 102 | new xmlrpcval($title, 'string'), |
@@ -118,7 +118,7 @@ function sendFromUpdate($username, $verification, $verificationID, $subscription | |||
118 | 118 | ||
119 | function sendFromCentral($cserver, $verification, $verificationID, $subscription, $title, $author, $url, $semantics, $softwareVersion, $databaseVersion) | 119 | function sendFromCentral($cserver, $verification, $verificationID, $subscription, $title, $author, $url, $semantics, $softwareVersion, $databaseVersion) |
120 | { | 120 | { |
121 | if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'key')) | 121 | if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'code')) |
122 | { | 122 | { |
123 | if ($softwareVersion > instaDisc_getConfig('softwareVersion')) | 123 | if ($softwareVersion > instaDisc_getConfig('softwareVersion')) |
124 | { | 124 | { |
@@ -134,7 +134,7 @@ function sendFromCentral($cserver, $verification, $verificationID, $subscription | |||
134 | 134 | ||
135 | $client = new xmlrpc_client($cserver); | 135 | $client = new xmlrpc_client($cserver); |
136 | $msg = new xmlrpcmsg("InstaDisc.sendUpdateNotice", array( new xmlrpcval($cserver2, 'string'), | 136 | $msg = new xmlrpcmsg("InstaDisc.sendUpdateNotice", array( new xmlrpcval($cserver2, 'string'), |
137 | new xmlrpcval(md5($cserver2 . ':' . $getuk3['key'] . ':' . $verID), 'string'), | 137 | new xmlrpcval(md5($cserver2 . ':' . $getuk3['code'] . ':' . $verID), 'string'), |
138 | new xmlrpcval($verID, 'int'), | 138 | new xmlrpcval($verID, 'int'), |
139 | new xmlrpcval(instaDisc_getConfig('softwareVersion'), 'int'))); | 139 | new xmlrpcval(instaDisc_getConfig('softwareVersion'), 'int'))); |
140 | $client->send($msg); | 140 | $client->send($msg); |
@@ -151,7 +151,7 @@ function sendFromCentral($cserver, $verification, $verificationID, $subscription | |||
151 | 151 | ||
152 | $client = new xmlrpc_client($cserver); | 152 | $client = new xmlrpc_client($cserver); |
153 | $msg = new xmlrpcmsg("InstaDisc.askForDatabase", array( new xmlrpcval($cserver2, 'string'), | 153 | $msg = new xmlrpcmsg("InstaDisc.askForDatabase", array( new xmlrpcval($cserver2, 'string'), |
154 | new xmlrpcval(md5($cserver2 . ':' . $getuk3['key'] . ':' . $verID), 'string'), | 154 | new xmlrpcval(md5($cserver2 . ':' . $getuk3['code'] . ':' . $verID), 'string'), |
155 | new xmlrpcval($verID, 'int'), | 155 | new xmlrpcval($verID, 'int'), |
156 | new xmlrpcval(instaDisc_getConfig('databaseVersion'), 'int'))); | 156 | new xmlrpcval(instaDisc_getConfig('databaseVersion'), 'int'))); |
157 | $client->send($msg); | 157 | $client->send($msg); |
@@ -177,7 +177,7 @@ function sendFromCentral($cserver, $verification, $verificationID, $subscription | |||
177 | 177 | ||
178 | function sendUpdateNotice($cserver, $verification, $verificationID, $softwareVersion) | 178 | function sendUpdateNotice($cserver, $verification, $verificationID, $softwareVersion) |
179 | { | 179 | { |
180 | if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'key')) | 180 | if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'code')) |
181 | { | 181 | { |
182 | if ($softwareVersion > instaDisc_getConfig('softwareVersion')) | 182 | if ($softwareVersion > instaDisc_getConfig('softwareVersion')) |
183 | { | 183 | { |
@@ -192,7 +192,7 @@ function sendUpdateNotice($cserver, $verification, $verificationID, $softwareVer | |||
192 | 192 | ||
193 | function askForDatabase($cserver, $verification, $verificationID, $databaseVersion) | 193 | function askForDatabase($cserver, $verification, $verificationID, $databaseVersion) |
194 | { | 194 | { |
195 | if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'key')) | 195 | if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'code')) |
196 | { | 196 | { |
197 | if ($databaseVersion < instaDisc_getConfig('databaseVersion')) | 197 | if ($databaseVersion < instaDisc_getConfig('databaseVersion')) |
198 | { | 198 | { |
@@ -239,7 +239,7 @@ function addSubscription($username, $verification, $verificationID, $subscriptio | |||
239 | 239 | ||
240 | function sendDatabase($cserver, $verification, $verificationID, $db) | 240 | function sendDatabase($cserver, $verification, $verificationID, $db) |
241 | { | 241 | { |
242 | if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'key')) | 242 | if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'code')) |
243 | { | 243 | { |
244 | if (isset($db['central.fourisland.com'])) | 244 | if (isset($db['central.fourisland.com'])) |
245 | { | 245 | { |
@@ -247,14 +247,14 @@ function sendDatabase($cserver, $verification, $verificationID, $db) | |||
247 | $getfi2 = mysql_query($getfi); | 247 | $getfi2 = mysql_query($getfi); |
248 | $getfi3 = mysql_fetch_array($getfi2); | 248 | $getfi3 = mysql_fetch_array($getfi2); |
249 | 249 | ||
250 | if ($db['central.fourisland.com']['key'] == $getfi3['key']) | 250 | if ($db['central.fourisland.com']['code'] == $getfi3['code']) |
251 | { | 251 | { |
252 | $deldb = "DELETE FROM centralServers"; | 252 | $deldb = "DELETE FROM centralServers"; |
253 | $deldb2 = mysql_query($deldb); | 253 | $deldb2 = mysql_query($deldb); |
254 | 254 | ||
255 | foreach($db as $name => $value) | 255 | foreach($db as $name => $value) |
256 | { | 256 | { |
257 | $insdb = "INSERT INTO centralServers (url, key, xmlrpc) VALUES (\"" . mysql_real_escape_string($name) . "\", \"" . mysql_real_escape_string($value['key']) . "\", \"" . mysql_real_escape_string($value['xmlrpc']) . "\")"; | 257 | $insdb = "INSERT INTO centralServers (url, code, xmlrpc) VALUES (\"" . mysql_real_escape_string($name) . "\", \"" . mysql_real_escape_string($value['code']) . "\", \"" . mysql_real_escape_string($value['xmlrpc']) . "\")"; |
258 | $insdb2 = mysql_query($insdb); | 258 | $insdb2 = mysql_query($insdb); |
259 | } | 259 | } |
260 | 260 | ||