From 077a209db289a1f78e9e9f14135d0f3308b4c582 Mon Sep 17 00:00:00 2001 From: wilpig Date: Tue, 9 Jun 2015 14:18:54 -0400 Subject: [PATCH] Fixing a bug in the installer and a missing table. #555 --- api/v1/index.php | 19 ++++++++++++++++--- db-3.3-to-4.0.sql | 17 +++++++++++++++++ install.php | 4 ++-- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/api/v1/index.php b/api/v1/index.php index d5b0655b5..6e50b0a19 100644 --- a/api/v1/index.php +++ b/api/v1/index.php @@ -1,13 +1,26 @@ get('/test', function() { + $response['error'] = false; + $response['errorcode'] = 200; + echoResponse(200, $response); +}); + + // load up the rest of our dependencies for the app + require_once( "../../db.inc.php" ); + require_once( "../../facilities.inc.php" ); + /* * * General notes about the API diff --git a/db-3.3-to-4.0.sql b/db-3.3-to-4.0.sql index 232af0cac..1731708bb 100644 --- a/db-3.3-to-4.0.sql +++ b/db-3.3-to-4.0.sql @@ -1,3 +1,20 @@ +-- +-- Fix for an ancient bug that was just discovered +-- + +CREATE TABLE IF NOT EXISTS fac_Zone ( + ZoneID int(11) NOT NULL AUTO_INCREMENT, + DataCenterID int(11) NOT NULL, + Description varchar(120) NOT NULL, + MapX1 int(11) NOT NULL, + MapY1 int(11) NOT NULL, + MapX2 int(11) NOT NULL, + MapY2 int(11) NOT NULL, + MapZoom int(11) DEFAULT '100' NOT NULL, + PRIMARY KEY (ZoneID), + KEY DataCenterID (DataCenterID) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + -- -- Move entries from fac_CabinetAudit to fac_GenericLog -- diff --git a/install.php b/install.php index fdd23c393..b1a8d58a0 100644 --- a/install.php +++ b/install.php @@ -94,7 +94,7 @@ } }else{ $tests['authentication']['state']="fail"; - $tests['authentication']['message']=($tests['db.inc']['state']=="good")?"You didn't read the upgrade notes. Jerk.":"How can you expect to work this if you can't even copy the db.inc.php into the right place?"; + $tests['authentication']['message']=($tests['db.inc']['state']=="good")?"You didn't read the upgrade notes. Jerk. There is no AUTHENTICATION defined in db.inc.php":"How can you expect to work this if you can't even copy the db.inc.php into the right place?"; $errors++; } @@ -117,7 +117,7 @@ $errors++; } if ($errors >0 || !isset($_GET['preflight-ok'])) { - echo 'openDCIM :: pre-flight environment sanity check

Pre-flight environment checks

'; + echo 'openDCIM :: pre-flight environment sanity check

Pre-flight environment checks

'; foreach($tests as $test => $text){ $hide=($test=='api_test')?' class="hide"':''; print "";
$test{$text['message']}{$text['state']}