[Mapbender-commits] r1746 - trunk/mapbender/http/extensions

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Oct 26 06:32:50 EDT 2007


Author: christoph
Date: 2007-10-26 06:32:50 -0400 (Fri, 26 Oct 2007)
New Revision: 1746

Modified:
   trunk/mapbender/http/extensions/geom2wfst.php
Log:
added notices and exceptions

Modified: trunk/mapbender/http/extensions/geom2wfst.php
===================================================================
--- trunk/mapbender/http/extensions/geom2wfst.php	2007-10-26 10:25:06 UTC (rev 1745)
+++ trunk/mapbender/http/extensions/geom2wfst.php	2007-10-26 10:32:50 UTC (rev 1746)
@@ -56,14 +56,20 @@
 		}
 	}
 	if (!empty($auth_varname)) {
+		$e = new mb_notice("geom2wfst: addParameterToFilter: auth_varname = " . $auth_varname);
+		$e = new mb_notice("geom2wfst: addParameterToFilter: element_name = " . $element_name);
 
 		if (isValidVarName($auth_varname)) {
 			$user = eval("return " . $auth_varname . ";");
 			
+			$e = new mb_notice("geom2wfst: addParameterToFilter: user should be " . $_SESSION["mb_user_id"]);
+			$e = new mb_notice("geom2wfst: addParameterToFilter: user is " . $user);
 			$patternUpdate = "(<wfs:Update[^>]*>)";
 			$patternInsert = "(<wfs:Insert[^>]*>)";
 			$patternDelete = "(<wfs:Delete[^>]*>)";
 
+			$e = new mb_notice("geom2wfst: addParameterToFilter: old filter was: " . $filter);
+
 			// insert: store authenticated user in database 
 			if (eregi($patternInsert, $filter)) {
 				$pattern = "(<" . $featuretype_name . ">)";
@@ -76,8 +82,15 @@
 				$replacement = "\\1<And>\\2<ogc:PropertyIsEqualTo><ogc:PropertyName>" . $element_name . "</ogc:PropertyName><ogc:Literal>" . $user . "</ogc:Literal></ogc:PropertyIsEqualTo></And>\\3"; 
 				$filter = eregi_replace($pattern, $replacement, $filter);
 			}
+			$e = new mb_notice("geom2wfst: addParameterToFilter: new filter is: " . $filter);
 		}
+		else {
+			$e = new mb_exception("geom2wfst: addParameterToFilter: invalid auth_varname (".$auth_varname.")");
+		}
 	}
+	else {
+		$e = new mb_notice("geom2wfst: addParameterToFilter: no auth_varname.");
+	}
 	return $filter;
 			
 }
@@ -140,4 +153,5 @@
 	echo "\"error message\":\"".addslashes($data)."\",";
 }
 echo "\"response\":\"".$response."\"}";
+$notice = new mb_notice("response:".$response);
 ?>
\ No newline at end of file



More information about the Mapbender_commits mailing list