diff options
author | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
commit | 134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch) | |
tree | 216b89d3fb89acfb81be1e440c25c41ab09fa96d /web/register.php | |
parent | More changing to production grid. Double oops. (diff) | |
download | opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.zip opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.gz opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.bz2 opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.xz |
Initial update to OpenSim 0.8.2.1 source code.
Diffstat (limited to 'web/register.php')
-rw-r--r-- | web/register.php | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/web/register.php b/web/register.php deleted file mode 100644 index 70f42a6..0000000 --- a/web/register.php +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | <?php | ||
2 | ////////////////////////////////////////////////////////////////////////////// | ||
3 | // register.php // | ||
4 | // (C) 2008, Fly-man- // | ||
5 | // This file contains the registration of a simulator to the database // | ||
6 | // and checks if the simulator is new in the database or a reconnected one // | ||
7 | // // | ||
8 | // If the simulator is old, check if the nextcheck date > registration // | ||
9 | // When the date is older, make a request to the Parser to grab new data // | ||
10 | ////////////////////////////////////////////////////////////////////////////// | ||
11 | |||
12 | include("../config/os_modules_mysql.php"); | ||
13 | //establish connection to master db server | ||
14 | mysql_connect ($DB_HOST, $DB_USER, $DB_PASSWORD); | ||
15 | mysql_select_db ($DB_NAME); | ||
16 | |||
17 | $hostname = $_GET['host']; | ||
18 | $port = $_GET['port']; | ||
19 | $service = $_GET['service']; | ||
20 | |||
21 | if ($hostname != "" && $port != "" && $service == "online") | ||
22 | { | ||
23 | // Check if there is already a database row for this host | ||
24 | $checkhost = mysql_query("SELECT register FROM hostsregister WHERE " . | ||
25 | "host = '" . mysql_real_escape_string($hostname) . "' AND " . | ||
26 | "port = '" . mysql_real_escape_string($port) . "'"); | ||
27 | |||
28 | // Get the request time as a timestamp for later | ||
29 | $timestamp = $_SERVER['REQUEST_TIME']; | ||
30 | |||
31 | // if greater than 1, check the nextcheck date | ||
32 | if (mysql_num_rows($checkhost) > 0) | ||
33 | { | ||
34 | $update = "UPDATE hostsregister SET " . | ||
35 | "register = '" . mysql_real_escape_string($timestamp) . "', " . | ||
36 | "nextcheck = '0', checked = '0', " . | ||
37 | "failcounter = '0' " . | ||
38 | "WHERE host = '" . mysql_real_escape_string($hostname) . "' AND " . | ||
39 | "port = '" . mysql_real_escape_string($port) . "'"; | ||
40 | |||
41 | $runupdate = mysql_query($update); | ||
42 | } | ||
43 | else | ||
44 | { | ||
45 | $register = "INSERT INTO hostsregister VALUES ". | ||
46 | "('" . mysql_real_escape_string($hostname) . "', " . | ||
47 | "'" . mysql_real_escape_string($port) . "', " . | ||
48 | "'" . mysql_real_escape_string($timestamp) . "', 0, 0, 0)"; | ||
49 | |||
50 | $runupdate = mysql_query($register); | ||
51 | } | ||
52 | } | ||
53 | elseif ($hostname != "" && $port != "" && $service = "offline") | ||
54 | { | ||
55 | $delete = "DELETE FROM hostsregister " . | ||
56 | "WHERE host = '" . mysql_real_escape_string($hostname) . "' AND " . | ||
57 | "port = '" . mysql_real_escape_string($port) . "'"; | ||
58 | |||
59 | $rundelete = mysql_query($delete); | ||
60 | } | ||
61 | ?> | ||