about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--central/trunk/instadisc.php5
-rw-r--r--central/trunk/xmlrpc.php12
2 files changed, 9 insertions, 8 deletions
diff --git a/central/trunk/instadisc.php b/central/trunk/instadisc.php index c9bf051..98a9385 100644 --- a/central/trunk/instadisc.php +++ b/central/trunk/instadisc.php
@@ -91,11 +91,12 @@ function instaDisc_sendDatabase($cserver)
91 $i=0; 91 $i=0;
92 while ($getdb3[$i] = mysql_fetch_array($getdb2)) 92 while ($getdb3[$i] = mysql_fetch_array($getdb2))
93 { 93 {
94 $db[$getdb3[$i]['url']] = $getdb3[$i]['key']; 94 $db[$getdb3[$i]['url']]['key'] = $getdb3[$i]['key'];
95 $db[$getdb3[$i]['url']]['xmlrpc'] = $getdb3[$i]['xmlrpc'];
95 $i++; 96 $i++;
96 } 97 }
97 98
98 $cserver2 = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; 99 $cserver2 = $_SERVER['HTTP_HOST'];
99 $getuk = "SELECT * FROM centralServers WHERE url = \"" . mysql_escape_string($cserver2) . "\""; 100 $getuk = "SELECT * FROM centralServers WHERE url = \"" . mysql_escape_string($cserver2) . "\"";
100 $getuk2 = mysql_query($getuk); 101 $getuk2 = mysql_query($getuk);
101 $getuk3 = mysql_fetch_array($getuk2); 102 $getuk3 = mysql_fetch_array($getuk2);
diff --git a/central/trunk/xmlrpc.php b/central/trunk/xmlrpc.php index bbf2f2d..cd0bb06 100644 --- a/central/trunk/xmlrpc.php +++ b/central/trunk/xmlrpc.php
@@ -82,7 +82,7 @@ function sendFromUpdate($username, $verification, $verificationID, $subscription
82 $getusubs3 = mysql_fetch_array($getusubs2); 82 $getusubs3 = mysql_fetch_array($getusubs2);
83 if ($getusubs['username'] == $username) 83 if ($getusubs['username'] == $username)
84 { 84 {
85 $cserver = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; 85 $cserver = $_SERVER['HTTP_HOST'];
86 $getuk = "SELECT * FROM centralServers WHERE url = \"" . mysql_escape_string($cserver) . "\""; 86 $getuk = "SELECT * FROM centralServers WHERE url = \"" . mysql_escape_string($cserver) . "\"";
87 $getuk2 = mysql_query($getuk); 87 $getuk2 = mysql_query($getuk);
88 $getuk3 = mysql_fetch_array($getuk2); 88 $getuk3 = mysql_fetch_array($getuk2);
@@ -94,7 +94,7 @@ function sendFromUpdate($username, $verification, $verificationID, $subscription
94 { 94 {
95 $verID = rand(1,65536); 95 $verID = rand(1,65536);
96 96
97 $client = new xmlrpc_client($getcs3[$i]['url']); 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['key'] + ":" + $verID), 'string'),
100 new xmlrpcval($verID, 'int'), 100 new xmlrpcval($verID, 'int'),
@@ -125,7 +125,7 @@ function sendFromCentral($cserver, $verification, $verificationID, $subscription
125 instaDisc_sendUpdateNotice($softwareVersion); 125 instaDisc_sendUpdateNotice($softwareVersion);
126 } else if ($softwareVersion < instaDisc_getConfig('softwareVersion')) 126 } else if ($softwareVersion < instaDisc_getConfig('softwareVersion'))
127 { 127 {
128 $cserver2 = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; 128 $cserver2 = $_SERVER['HTTP_HOST'];
129 $getuk = "SELECT * FROM centralServers WHERE url = \"" . mysql_escape_string($cserver2) . "\""; 129 $getuk = "SELECT * FROM centralServers WHERE url = \"" . mysql_escape_string($cserver2) . "\"";
130 $getuk2 = mysql_query($getuk); 130 $getuk2 = mysql_query($getuk);
131 $getuk3 = mysql_fetch_array($getuk2); 131 $getuk3 = mysql_fetch_array($getuk2);
@@ -142,7 +142,7 @@ function sendFromCentral($cserver, $verification, $verificationID, $subscription
142 142
143 if ($databaseVersion > instaDisc_getConfig('databaseVersion')) 143 if ($databaseVersion > instaDisc_getConfig('databaseVersion'))
144 { 144 {
145 $cserver2 = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; 145 $cserver2 = $_SERVER['HTTP_HOST'];
146 $getuk = "SELECT * FROM centralServers WHERE url = \"" . mysql_escape_string($cserver2) . "\""; 146 $getuk = "SELECT * FROM centralServers WHERE url = \"" . mysql_escape_string($cserver2) . "\"";
147 $getuk2 = mysql_query($getuk); 147 $getuk2 = mysql_query($getuk);
148 $getuk3 = mysql_fetch_array($getuk2); 148 $getuk3 = mysql_fetch_array($getuk2);
@@ -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'] == $getfi3['key']) 250 if ($db['central.fourisland.com']['key'] == $getfi3['key'])
251 { 251 {
252 $deldb = "TRUNCATE TABLE centralServers"; 252 $deldb = "TRUNCATE TABLE 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) VALUES (\"" . mysql_escape_string($name) . "\", \"" . mysql_escape_string($value) . "\")"; 257 $insdb = "INSERT INTO centralServers (url, key, xmlrpc) VALUES (\"" . mysql_escape_string($name) . "\", \"" . mysql_escape_string($value['key']) . "\", \"" . mysql_escape_string($value['xmlrpc']) . "\")";
258 $insdb2 = mysql_query($insdb); 258 $insdb2 = mysql_query($insdb);
259 } 259 }
260 260