[Mapbender-commits] r2547 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jun 23 12:21:08 EDT 2008


Author: christoph
Date: 2008-06-23 12:21:08 -0400 (Mon, 23 Jun 2008)
New Revision: 2547

Removed:
   trunk/mapbender/http/php/mod_insertWmcIntoDb.php
Log:


Deleted: trunk/mapbender/http/php/mod_insertWmcIntoDb.php
===================================================================
--- trunk/mapbender/http/php/mod_insertWmcIntoDb.php	2008-06-23 16:20:25 UTC (rev 2546)
+++ trunk/mapbender/http/php/mod_insertWmcIntoDb.php	2008-06-23 16:21:08 UTC (rev 2547)
@@ -1,63 +0,0 @@
-<?php
-#$Id: mod_insertWmcIntoDb.php 1198 2007-10-18 14:37:52Z baudson $
-#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_insertWmcIntoDb.php,v 1.19 2006/03/09 14:02:42 uli_rothstein Exp $
-# Copyright (C) 2002 CCGIS 
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__)."/../classes/class_administration.php");
-require_once(dirname(__FILE__)."/../classes/class_wmc.php");
-require_once(dirname(__FILE__)."/../classes/class_json.php");
-
-$json = new Mapbender_JSON();
-$mapObject = $json->decode(stripslashes($_POST["mapObject"]));
-$user_id = $_SESSION["mb_user_id"];
-$save_in_session = $_POST["saveInSession"];
-$generalTitle = $_POST["generalTitle"];
-
-$extensionData = $json->decode(stripslashes($_POST["extensionData"]));
-
-$wmc = new wmc();
-$wmc->createWMCFromObj($mapObject, $user_id, $generalTitle, $extensionData);
-
-if ($save_in_session) {
-	$_SESSION["mb_wmc"] = $wmc->xml;
-	$_SESSION["epsg"] = $mapObject->epsg;
-	$_SESSION["previous_gui"] = $_SESSION["mb_user_gui"];
-	$e = new mb_notice("mod_insertWMCIntoDB: save WMC in session succeeded.");
-}
-else {
-	if ($user_id && $wmc->wmc_id) {
-		$sql = "INSERT INTO mb_user_wmc VALUES ($1, $2, $3, $4, $5)";
-		$v = array($wmc->wmc_id, $user_id, $wmc->xml, $generalTitle, time());
-		$t = array("s", "i", "s", "s", "s");
-		
-		$res = db_prep_query($sql, $v, $t);
-		if (db_error()) {
-			$errMsg = "Error while saving WMC document '" . $generalTitle . "': " . db_error();
-			echo $errMsg;
-			$e = new mb_exception("mod_insertWMCIntoDB: " . $errMsg);
-		}
-		else {
-			echo "WMC document '" . $generalTitle . "' has been saved.";
-			$e = new mb_notice("mod_insertWMCIntoDB: WMC  '" . $generalTitle . "' saved successfully.");
-		}
-	}
-	else {
-		$e = new mb_exception("mod_insertWMCIntoDB: missing parameters (user_id: ".$user_id.", wmc_id: ".$wmc->wmc_id."))");
-	}
-}
-?>
\ No newline at end of file



More information about the Mapbender_commits mailing list