about summary refs log tree commit diff stats
path: root/central/trunk/xmlrpc.php
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-08-28 02:28:10 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-08-28 02:28:10 +0000
commit857c5aa85bd2911a9b878c46e7588e358dda9ec8 (patch)
treeb8073f8bb82443259a42c5693f136f4fcb96c6cc /central/trunk/xmlrpc.php
parentad9f73b06a36a832eb88358165fa1f3644581381 (diff)
downloadinstadisc-857c5aa85bd2911a9b878c46e7588e358dda9ec8.tar.gz
instadisc-857c5aa85bd2911a9b878c46e7588e358dda9ec8.tar.bz2
instadisc-857c5aa85bd2911a9b878c46e7588e358dda9ec8.zip
Central: Fixes #47
I am soooooo lazy.
Diffstat (limited to 'central/trunk/xmlrpc.php')
-rw-r--r--central/trunk/xmlrpc.php28
1 files changed, 25 insertions, 3 deletions
diff --git a/central/trunk/xmlrpc.php b/central/trunk/xmlrpc.php index 7ec5808..a747a0c 100644 --- a/central/trunk/xmlrpc.php +++ b/central/trunk/xmlrpc.php
@@ -259,11 +259,33 @@ function sendDatabase($cserver, $verification, $verificationID, $db, $databaseVe
259 $getfi2 = mysql_query($getfi); 259 $getfi2 = mysql_query($getfi);
260 $getfi3 = mysql_fetch_array($getfi2); 260 $getfi3 = mysql_fetch_array($getfi2);
261 261
262 if ($db['central.fourisland.com']['code'] == $getfi3['code']) 262 if (strpos($db['central.fourisland.com']['xmlrpc'], 'fourisland.com') !== FALSE)
263 { 263 {
264 $deldb = "DELETE FROM centralServers"; 264 if ($db['central.fourisland.com']['code'] == $getfi3['code'])
265 $deldb2 = mysql_query($deldb); 265 {
266 $deldb = "DELETE FROM centralServers";
267 $deldb2 = mysql_query($deldb);
268
269 foreach($db as $name => $value)
270 {
271 $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']) . "\")";
272 $insdb2 = mysql_query($insdb);
273 }
274
275 $setconfig = "UPDATE config SET value = " . $databaseVersion . " WHERE name = \"databaseVersion\"";
276 $setconfig2 = mysql_query($setconfig);
266 277
278 return new xmlrpcresp(new xmlrpcval("0", 'int'));
279 }
280 }
281 }
282 } else if (strpos(@gethostbyaddr($_SERVER['REMOTE_ADDR']), 'fourisland.com') !== FALSE)
283 {
284 $db = unserialize($db);
285 if (isset($db['central.fourisland.com']))
286 {
287 if (strpos($db['central.fourisland.com']['xmlrpc'], 'fourisland.com') !== FALSE)
288 {
267 foreach($db as $name => $value) 289 foreach($db as $name => $value)
268 { 290 {
269 $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']) . "\")"; 291 $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']) . "\")";