[Mapbender-commits] r4942 - trunk/mapbender/core
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Nov 5 08:43:05 EST 2009
Author: christoph
Date: 2009-11-05 08:43:03 -0500 (Thu, 05 Nov 2009)
New Revision: 4942
Modified:
trunk/mapbender/core/globalSettings.php
Log:
Modified: trunk/mapbender/core/globalSettings.php
===================================================================
--- trunk/mapbender/core/globalSettings.php 2009-11-05 13:19:08 UTC (rev 4941)
+++ trunk/mapbender/core/globalSettings.php 2009-11-05 13:43:03 UTC (rev 4942)
@@ -22,10 +22,23 @@
//
session_start();
-require_once(dirname(__FILE__)."/../http/extensions/FirePHP.class.php");
+//
+// constants
+//
+require_once(dirname(__FILE__)."/../core/system.php");
-$firephp = FirePHP::getInstance(true);
+//
+// Add FirePHP for debugging only, supply a global $firephp
+//
+if (defined(LOG_PHP_WITH_FIREPHP) && LOG_PHP_WITH_FIREPHP === "on") {
+ require_once(dirname(__FILE__)."/../http/extensions/FirePHP-0.3/FirePHP.class.php");
+
+ $firephp = FirePHP::getInstance(true);
+}
+//
+// Basic Mapbender classes, for session handling etc.
+//
require_once(dirname(__FILE__)."/../lib/class_Mapbender.php");
//
@@ -66,11 +79,6 @@
//
-// constants
-//
-require_once(dirname(__FILE__)."/../core/system.php");
-
-//
// configuration file
//
require_once(dirname(__FILE__)."/../conf/mapbender.conf");
@@ -114,5 +122,24 @@
require_once(dirname(__FILE__)."/../lib/ajax.php");
+//
+// get real ip address, can be improved, see
+// http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html
+//
+function getRealIpAddr() {
+ if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
+ {
+ $ip=$_SERVER['HTTP_CLIENT_IP'];
+ }
+ elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
+ {
+ $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
+ }
+ else
+ {
+ $ip=$_SERVER['REMOTE_ADDR'];
+ }
+ return $ip;
+}
?>
More information about the Mapbender_commits
mailing list