[Mapbender-commits] r2292 - branches/nimix_dev/owsproxy/http

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Mar 25 12:33:13 EDT 2008


Author: nimix
Date: 2008-03-25 12:33:13 -0400 (Tue, 25 Mar 2008)
New Revision: 2292

Modified:
   branches/nimix_dev/owsproxy/http/index.php
Log:
url replacement

Modified: branches/nimix_dev/owsproxy/http/index.php
===================================================================
--- branches/nimix_dev/owsproxy/http/index.php	2008-03-25 15:23:15 UTC (rev 2291)
+++ branches/nimix_dev/owsproxy/http/index.php	2008-03-25 16:33:13 UTC (rev 2292)
@@ -48,6 +48,7 @@
 
 //look if username and password is given
 if(isset($name) && $name != '' && isset($password) && $password != ''){
+	//ingnore session
 	$user_row = $n->authUser($_REQUEST["name"], $_REQUEST["password"]);
 	if(!$user_row){
 		$notice = new mb_notice("Permission denied");
@@ -55,6 +56,7 @@
 		die();
 	}
 	$user_id = $user_row["mb_user_id"];
+	$auth_mode = "request";
 }
 else{
 	// check session
@@ -66,6 +68,7 @@
 		die();
 	}
 	$user_id = $_SESSION['mb_user_id'];
+	$auth_mode = "session";
 }
 
 //if($_SESSION['mb_user_ip'] != $_SERVER['REMOTE_ADDR']){
@@ -330,8 +333,11 @@
 }
 
 function setExternalRequest($id){
-	global $reqParams,$query;
-	$extReq = OWSPROXY ."/". $reqParams['sid'] ."/".$id."?request=external";
+	global $reqParams,$query,$auth_mode,$name,$password;
+	if($auth_mode=="session")
+		$extReq = OWSPROXY ."/". $reqParams['sid'] ."/".$id."?request=external";
+	elseif($auth_mode=="request")
+		$extReq = OWSPROXY ."/no/".$id."?name=".$name."&password=".$password."&request=external";
 	return $extReq;
 }
 function getExternalRequest($id){
@@ -391,9 +397,12 @@
 }
 function getCapabilities($url){
 	global $arrayOnlineresources;
-	global $sid,$wms;
-	$t = array(htmlentities($arrayOnlineresources["wms_getcapabilities"]),htmlentities($arrayOnlineresources["wms_getmap"]),htmlentities($arrayOnlineresources["$wms_getfeatureinfo"]));
-	$new = OWSPROXY ."/". $sid ."/".$wms."?";
+	global $sid,$owsproxyService,$auth_mode,$name,$password;
+	$t = array(htmlentities($arrayOnlineresources["wms_getcapabilities"]),htmlentities($arrayOnlineresources["wms_getmap"]),htmlentities($arrayOnlineresources["wms_getfeatureinfo"]));
+	if($auth_mode=="session")
+		$new = OWSPROXY ."/". $sid ."/".$owsproxyService."?";
+	elseif($auth_mode=="request")
+		$new = OWSPROXY ."/no/". $owsproxyService."?name=".$name."&password=".$password."&";
 	$r = str_replace($t,$new,$arrayOnlineresources["wms_getcapabilities_doc"]);
 	header("Content-Type: application/xml");
 	echo $r;



More information about the Mapbender_commits mailing list