svn commit: r120 - trunk/mapbender/owsproxy

uli at osgeo.org uli at osgeo.org
Thu Apr 20 15:40:41 EDT 2006


Author: uli
Date: 2006-04-20 19:40:41+0000
New Revision: 120

Added:
   trunk/mapbender/owsproxy/
   trunk/mapbender/owsproxy/index.php

Log:
first check in
module in process

Added: trunk/mapbender/owsproxy/index.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/owsproxy/index.php?view=auto&rev=120
==============================================================================
--- (empty file)
+++ trunk/mapbender/owsproxy/index.php	2006-04-20 19:40:41+0000
@@ -0,0 +1,47 @@
+<?php
+// conf
+$imageformats = array("image/png","image/gif","image/jpeg", "image/jpg");
+
+// variablen auslesen
+#print_r($_REQUEST);
+$myVar = array_keys($_REQUEST);
+for($i=0; $i<count($myVar); $i++){
+	$tmp[$i] = strtolower($myVar[$i]);
+	$$tmp[$i]  = $_REQUEST[$myVar[$i]];
+}
+// session überprüfen
+session_id($_REQUEST["sid"]);
+session_start();
+if($_SESSION['mb_user_ip'] != $_SERVER['REMOTE_ADDR']){
+	throwE(array("No Sessiondate availabel.","Permission denied.","Please authenticate."));	
+}
+// Datenbanküberprüfung vornehmen
+
+// onlineresource ermitteln
+
+function throwE($e){
+	global $format, $imageformats;
+	if(in_array($format,$imageformats)){
+		throwImage($e);
+	}
+	else{
+		throwText($e);	
+	}	
+}
+function throwImage($e){
+	global $width,$height;
+	$image = imagecreate($width,$height);
+	$transparent = ImageColorAllocate($image,155,155,155); 
+	ImageFilledRectangle($image,0,0,$width,$height,$transparent);
+	imagecolortransparent($image, $transparent);
+	$text_color = ImageColorAllocate ($image, 233, 14, 91);
+	for($i=0; $i<count($e); $i++){
+		ImageString ($image, 3, 5, $i*20, $e[$i], $text_color);
+	}
+	header("Content-Type: image/png"); 
+	imagepng($image);
+}
+function throwText($e){
+	echo join(" ", $e);
+}
+?>
\ No newline at end of file




More information about the Mapbender_commits mailing list