diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-28 02:28:10 +0000 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-28 02:28:10 +0000 |
commit | 857c5aa85bd2911a9b878c46e7588e358dda9ec8 (patch) | |
tree | b8073f8bb82443259a42c5693f136f4fcb96c6cc /central | |
parent | ad9f73b06a36a832eb88358165fa1f3644581381 (diff) | |
download | instadisc-857c5aa85bd2911a9b878c46e7588e358dda9ec8.tar.gz instadisc-857c5aa85bd2911a9b878c46e7588e358dda9ec8.tar.bz2 instadisc-857c5aa85bd2911a9b878c46e7588e358dda9ec8.zip |
Central: Fixes #47
I am soooooo lazy.
Diffstat (limited to 'central')
-rw-r--r-- | central/trunk/install.php | 5 | ||||
-rw-r--r-- | central/trunk/theme/mansub.tpl | 1 | ||||
-rw-r--r-- | central/trunk/xmlrpc.php | 28 |
3 files changed, 28 insertions, 6 deletions
diff --git a/central/trunk/install.php b/central/trunk/install.php index c056431..59a83c9 100644 --- a/central/trunk/install.php +++ b/central/trunk/install.php | |||
@@ -197,8 +197,7 @@ if (!isset($_GET['submit'])) | |||
197 | $sql[9] = "INSERT INTO config (name,value) VALUES (\"softwareVersion\",\"" . $softwareVersion . "\")"; | 197 | $sql[9] = "INSERT INTO config (name,value) VALUES (\"softwareVersion\",\"" . $softwareVersion . "\")"; |
198 | $sql[10] = "INSERT INTO config (name,value) VALUES (\"databaseVersion\",\"1\")"; | 198 | $sql[10] = "INSERT INTO config (name,value) VALUES (\"databaseVersion\",\"1\")"; |
199 | $sql[11] = "INSERT INTO users (username, password, email, ip) VALUES (\"" . mysql_real_escape_string($_POST['adminUser']) . "\",\"" . mysql_real_escape_string(md5($_POST['adminPass'])) . "\",\"" . mysql_real_escape_string($_POST['adminEmail']) . "\",\"" . mysql_real_escape_string($_SERVER['REMOTE_ADDR']) . "\")"; | 199 | $sql[11] = "INSERT INTO users (username, password, email, ip) VALUES (\"" . mysql_real_escape_string($_POST['adminUser']) . "\",\"" . mysql_real_escape_string(md5($_POST['adminPass'])) . "\",\"" . mysql_real_escape_string($_POST['adminEmail']) . "\",\"" . mysql_real_escape_string($_SERVER['REMOTE_ADDR']) . "\")"; |
200 | $sql[12] = "INSERT INTO centralServers (url, code, xmlrpc) VALUES (\"" . mysql_real_escape_string('central.fourisland.com') . "\",\"" . mysql_real_escape_string(md5('central.fourisland.com')) . "\",\"" . mysql_real_escape_string('http://central.fourisland.com/xmlrpc.php') . "\")"; | 200 | $sql[12] = "INSERT INTO subscriptions (username, url, owner, category) VALUES (\"" . mysql_real_escape_string($_POST['adminUser']) . "\", \"" . mysql_real_escape_string('http://fourisland.com/' . $_SERVER['SERVER_NAME'] . '/') . "\", \"true\", \"instadisc\")"; |
201 | $sql[13] = "INSERT INTO subscriptions (username, url, owner, category) VALUES (\"" . mysql_real_escape_string($_POST['adminUser']) . "\", \"" . mysql_real_escape_string('http://fourisland.com/' . $_SERVER['SERVER_NAME'] . '/') . "\", \"true\", \"instadisc\")"; | ||
202 | 201 | ||
203 | foreach ($sql as $name => $value) | 202 | foreach ($sql as $name => $value) |
204 | { | 203 | { |
@@ -348,7 +347,7 @@ function showStepTwo($mailDomain, $smtpHost, $smtpAuth, $smtpUser, $smtpPass, $s | |||
348 | 347 | ||
349 | function showStepThree() | 348 | function showStepThree() |
350 | { | 349 | { |
351 | ?>Congradulations! You've successfully set up your InstaDisc Central Server's database! Now, the next step for you is to implement the functions in instadisc.php into your web application. See <A HREF="http://fourisland.com/projects/instadisc/wiki/BecomingACentralServer">Becoming A Central Server</A>. Also, it would be smart to subscribe to your InstaDisc Update Notice Subscription, which will notify you if your Central Server's software gets out of date. It's the subscription.php file in this directory. Please subscribe to it, thanks!<?php | 350 | ?>Congradulations! You've successfully set up your InstaDisc Central Server's database! Now, the next step for you is to implement the functions in instadisc.php into your web application. See <A HREF="http://fourisland.com/projects/instadisc/wiki/BecomingACentralServer">Becoming A Central Server</A>. Also, it would be smart to subscribe to your InstaDisc Update Notice Subscription, which will notify you if your Central Server's software gets out of date. It's the subscription.php file in this directory. Please subscribe to it, thanks!<P>However, remember that to be any use to anyone, you need your Central Server database, and to be added to others'. To do this, please find the appropriate help section on http://fourisland.com/projects/instadisc/BecomingACentralServer<?php |
352 | } | 351 | } |
353 | 352 | ||
354 | function ifErrors($errors, $id) | 353 | function ifErrors($errors, $id) |
diff --git a/central/trunk/theme/mansub.tpl b/central/trunk/theme/mansub.tpl index a9c8850..23639b1 100644 --- a/central/trunk/theme/mansub.tpl +++ b/central/trunk/theme/mansub.tpl | |||
@@ -1,6 +1,7 @@ | |||
1 | <HTML> | 1 | <HTML> |
2 | <HEAD> | 2 | <HEAD> |
3 | <TITLE><!--SITENAME--> InstaDisc Central Server</TITLE> | 3 | <TITLE><!--SITENAME--> InstaDisc Central Server</TITLE> |
4 | <LINK REL="stylesheet" HREF="theme/table.css"> | ||
4 | </HEAD> | 5 | </HEAD> |
5 | 6 | ||
6 | <BODY> | 7 | <BODY> |
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']) . "\")"; |