Rearrange includes so session can act on GET/POST variables
[busui.git] / include / common.inc.php
blob:a/include/common.inc.php -> blob:b/include/common.inc.php
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -6,7 +6,7 @@
 	"phperror",
 	"awsotp",
 	//"squallotp",
-	"vanilleotp",
+	//"vanilleotp",
 	"database",
 	"other"
 );
@@ -26,6 +26,14 @@
 		$otpAPIurl = 'http://10.0.1.135:8080/opentripplanner-api-webapp/';
 }
 if (isDebug("phperror")) error_reporting(E_ALL ^ E_NOTICE);
+$labsPath = "";
+if (strstr($_SERVER['PHP_SELF'],"labs")) $labsPath = "../";
+
+function isDebugServer()
+{
+	return isset($_SERVER['SERVER_NAME']) && ( $_SERVER['SERVER_NAME'] == "10.0.1.154" || $_SERVER['SERVER_NAME'] == "10.1.0.4" || $_SERVER['SERVER_NAME'] == 
+"localhost" || $_SERVER['SERVER_NAME'] == "127.0.0.1") ;
+}
 
 include_once ("common-geo.inc.php");
 include_once ("common-net.inc.php");
@@ -36,10 +44,7 @@
 include_once ("common-session.inc.php");
 include_once ("common-template.inc.php");
 
-function isDebugServer()
-{
-	return $_SERVER['SERVER_NAME'] == "10.0.1.154" || $_SERVER['SERVER_NAME'] == "localhost" || $_SERVER['SERVER_NAME'] == "127.0.0.1" || !$_SERVER['SERVER_NAME'];
-}
+
 function isAnalyticsOn()
 {
 	return !isDebugServer();
@@ -163,7 +168,7 @@
 			$key => $val
 		));
 	}
-	if ($sort_ascending) $array = array_reverse($temp_array);
+	if ($sort_ascending && isset($temp_array)) $array = array_reverse($temp_array);
 	else $array = $temp_array;
 }
 function r_implode( $glue, $pieces )