[Mapbender-commits] r6251 - in branches/2.6/http: javascripts php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jun 9 06:00:25 EDT 2010


Author: tbaschetti
Date: 2010-06-09 06:00:24 -0400 (Wed, 09 Jun 2010)
New Revision: 6251

Modified:
   branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php
   branches/2.6/http/php/mod_wfs_gazetteer_server.php
Log:
fixed http://trac.osgeo.org/mapbender/ticket/627


Modified: branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php	2010-06-08 15:20:55 UTC (rev 6250)
+++ branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php	2010-06-09 10:00:24 UTC (rev 6251)
@@ -372,7 +372,7 @@
 
 	geomArray = new parent.GeometryArray();
 
-	parent.mb_ajax_json("../php/mod_wfs_gazetteer_server.php", {command:"getWfsConfsForThisApplication",wfsConfIdString:wfsConfIdString}, function(json, status) {
+	parent.mb_ajax_json("../php/mod_wfs_gazetteer_server.php", {command:"getWfsConf",wfsConfIdString:wfsConfIdString}, function(json, status) {
 		global_wfsConfObj = json;
 		var wfsCount = 0;
 		for (var wfsConfId in global_wfsConfObj) {

Modified: branches/2.6/http/php/mod_wfs_gazetteer_server.php
===================================================================
--- branches/2.6/http/php/mod_wfs_gazetteer_server.php	2010-06-08 15:20:55 UTC (rev 6250)
+++ branches/2.6/http/php/mod_wfs_gazetteer_server.php	2010-06-09 10:00:24 UTC (rev 6251)
@@ -84,10 +84,17 @@
 if ($command == "getWfsConf") {
 	
 	$wfsConfIdString = $_GET["wfsConfIdString"];
-	
+	$user = new User($_SESSION["mb_user_id"]);	
 	if ($wfsConfIdString != "") {
 		//array_keys(array_flip()) produces an array with unique entries
 		$wfsConfIdArray = array_keys(array_flip(mb_split(",", $wfsConfIdString)));
+    	$availableWfsConfIds = $user->getWfsConfByPermission($_SESSION["gui_id"]);	
+		$wfsConfIdArray = array_intersect($wfsConfIdArray, $availableWfsConfIds);
+		if (count($wfsConfIdArray) === 0) {
+			echo "no wfs conf available.";
+			die();
+		}
+
 	}
 	else {
 		echo "please specify wfs conf id.";
@@ -125,10 +132,10 @@
 	if (is_null($wfsConf)) {
 		sendErrorMessage("Invalid WFS conf: " . $wfs_conf_id);
 	}
-	
-	// append authorisation condition to filter
-	$filter = checkAccessConstraint($filter, $wfs_conf_id);
 	
+	// append authorisation condition to filter
+	$filter = checkAccessConstraint($filter, $wfs_conf_id);
+	
 	$admin = new administration();
 	
 	$filter = $admin->char_decode(stripslashes($filter));



More information about the Mapbender_commits mailing list