[Mapbender-commits] r7224 - trunk/mapbender/core
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Sat Dec 11 10:19:51 EST 2010
Author: arnulf
Date: 2010-12-11 07:19:51 -0800 (Sat, 11 Dec 2010)
New Revision: 7224
Modified:
trunk/mapbender/core/system.php
Log:
prepared statements set, core conf formatted
Modified: trunk/mapbender/core/system.php
===================================================================
--- trunk/mapbender/core/system.php 2010-12-11 15:19:46 UTC (rev 7223)
+++ trunk/mapbender/core/system.php 2010-12-11 15:19:51 UTC (rev 7224)
@@ -1,6 +1,6 @@
<?php
# $Id$
-# Copyright (C) 2002 CCGIS
+# Copyright (C) 2010 OSGeo
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,7 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
//define("SESSION_NAME", "TRUNK_SESSID");
#
# configuration file
@@ -35,7 +34,8 @@
#
define("MB_RESOLUTION", "28.35");
define("MB_FEATURE_COUNT", "100");
-define("MB_SECURITY_PROXY", "http://wms.wheregroup.com/mapbender/tools/security_proxy.php?mb_ows_security_proxy=");
+define("MB_SECURITY_PROXY", "");
+
#
# available log levels
#
@@ -82,11 +82,14 @@
define("MB_BASEDIR",realpath(dirname(__FILE__)."/../"));
+if(!defined("PREPAREDSTATEMENTS")){
+ define("PREPAREDSTATEMENTS", true);
+}
+
function secure($path,$folder = "",$fileExt = null) {
- $secure = true;
+ $secure = true;
if(!defined("MB_BASEDIR")){ throw new Exception("MB_BASEDIR must be defined in core/system.php"); }
-
$basedir = realpath(MB_BASEDIR."/".$folder);
$path = realpath($path);
// $path must be within the basedir (and optionally within the subdirectory within basedir given by the $folder parameter
@@ -94,10 +97,10 @@
// PATH END
if(!empty($fileExt) AND substr($path,-strlen($fileExt)) != $fileExt){
- $secure = false;
- }
+ $secure = false;
+ }
- if($secure){
+ if($secure){
return $path;
} else {
throw new Exception("This path is not allowed! '$path'");
@@ -108,11 +111,11 @@
* @security_patch Helper
*/
function security_patch_log($file,$line) {
- $h = fopen(dirname(__FILE__)."/../log/security_patch.log","a+");
- if($h) {
+ $h = fopen(dirname(__FILE__)."/../log/security_patch.log","a+");
+ if($h) {
fwrite($h,date("Y.m.d H:i")." FILE : ".$file." | LINE : ".$line." | POST : ".implode(",",array_keys($_POST))." | GET : ".implode(",",array_keys($_GET))." | FILE : ".implode(",",array_keys($_FILE))." |\n");
fclose($h);
- }
+ }
}
//
@@ -120,19 +123,19 @@
// 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;
+ 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