about summary refs log tree commit diff stats
path: root/central/trunk/xmlrpc.php
diff options
context:
space:
mode:
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']) . "\")";