[Mapbender-commits] r9481 - trunk/mapbender/tools

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu May 26 23:52:46 PDT 2016


Author: armin11
Date: 2016-05-26 23:52:46 -0700 (Thu, 26 May 2016)
New Revision: 9481

Modified:
   trunk/mapbender/tools/send_post_curl.php
Log:
Rewind wrong commit

Modified: trunk/mapbender/tools/send_post_curl.php
===================================================================
--- trunk/mapbender/tools/send_post_curl.php	2016-05-27 06:52:20 UTC (rev 9480)
+++ trunk/mapbender/tools/send_post_curl.php	2016-05-27 06:52:46 UTC (rev 9481)
@@ -89,9 +89,26 @@
 		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
 		curl_setopt($ch, CURLOPT_POST, 1);
 		curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
-		if(CONNECTION_PROXY != ""){
-			curl_setopt($ch, CURLOPT_PROXY,CONNECTION_PROXY.":".CONNECTION_PORT);	
-		}		
+	    	$NOT_PROXY_HOSTS_array = explode(",", NOT_PROXY_HOSTS);
+ 	    	//check if http_proxy is set as env, if yes, unset it for the curl action here, it will be reset somewhere below - normally not needed, cause it will be only available when at execution time of the script http://php.net/manual/en/function.putenv.php
+		if (getenv('http_proxy')) {
+			$e = new mb_notice("class_connector.php: current http_proxy: ".getenv('http_proxy')." will be unset by putenv('http_proxy')");
+			$tmpHttpProxy = getenv('http_proxy');
+			putenv("http_proxy"); //this should unset the variable???
+		} else {
+			$e = new mb_notice("class_connector.php: http_proxy is not set as env variable!");
+			$tmpHttpProxy = getenv('http_proxy');
+		}
+		//check if proxy is set and server not in NOT_PROXY_HOSTS
+ 	    	if(CONNECTION_PROXY != "" AND (in_array($host, $NOT_PROXY_HOSTS_array)!= true)){
+			curl_setopt($ch, CURLOPT_PROXY,CONNECTION_PROXY.":".CONNECTION_PORT);
+			$e = new mb_notice("class_connector.php: Proxy will be used!");
+			if(CONNECTION_PASSWORD != ""){
+				curl_setopt ($ch, CURLOPT_PROXYUSERPWD, CONNECTION_USER.':'.CONNECTION_PASSWORD);
+			}
+		} else {
+			$e = new mb_notice("class_connector.php: Proxy will not be used!");
+		}
 		if(CONNECTION_PASSWORD != ""){
 			curl_setopt ($ch, CURLOPT_PROXYUSERPWD, CONNECTION_USER.':'.CONNECTION_PASSWORD);	
 		}



More information about the Mapbender_commits mailing list