[Mapbender-commits] r10139 - in trunk/mapbender: http/frames http/javascripts http/php resources/db resources/db/pgsql/UTF-8/update
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Jun 6 02:30:35 PDT 2019
Author: armin11
Date: 2019-06-06 02:30:35 -0700 (Thu, 06 Jun 2019)
New Revision: 10139
Added:
trunk/mapbender/http/frames/cleanurl.php_deprecated
trunk/mapbender/http/javascripts/mod_initWmc.php_deprecated
trunk/mapbender/http/javascripts/mod_insertKmlIntoDb.php_deprecated
trunk/mapbender/http/javascripts/mod_saveWmcKml.php_deprecated
trunk/mapbender/http/php/mod_meetingPoint.php_deprecated
Removed:
trunk/mapbender/http/frames/cleanurl.php
trunk/mapbender/http/javascripts/mod_initWmc.php
trunk/mapbender/http/javascripts/mod_insertKmlIntoDb.php
trunk/mapbender/http/javascripts/mod_saveWmcKml.php
trunk/mapbender/http/php/mod_meetingPoint.php
Modified:
trunk/mapbender/resources/db/install_geoportal_mb28.sh
trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql
Log:
Some further things to use secure password hashes! Some functions are marked as deprecated, cause they are insecure!
Deleted: trunk/mapbender/http/frames/cleanurl.php
===================================================================
--- trunk/mapbender/http/frames/cleanurl.php 2019-06-05 16:29:36 UTC (rev 10138)
+++ trunk/mapbender/http/frames/cleanurl.php 2019-06-06 09:30:35 UTC (rev 10139)
@@ -1,50 +0,0 @@
-<?php
-# $Id$
-# 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.
-
-ob_start();
-include_once(dirname(__FILE__) . "/../../conf/mapbender.conf");
-include(dirname(__FILE__) . "/../classes/class_administration.php");
-
-
-$adm = new administration();
-
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
-
-$id = $_GET['id'];
-
-$sql = "SELECT * FROM mb_meetingpoint WHERE mb_meetingpoint_id = $1";
-$v = array($id);
-$t = array('s');
-$res = db_prep_query($sql,$v,$t);
-if($row = db_fetch_array($res)){
- $user = $adm->getUserNameByUserId($row['fkey_mb_user_id']);
- $password = $row['mb_user_password'];
- $gui_id = $row['fkey_gui_id'];
-}
-else {
- exit();
-}
-$url = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])."/login.php?";
-$url .= "name=".$user."&password=".urlencode($password)."&mb_user_myGui=".$gui_id."&kml_id=".$id;
-
-header ("Location: ".$url);
-ob_end_flush();
-?>
-</body>
-</html>
Added: trunk/mapbender/http/frames/cleanurl.php_deprecated
===================================================================
--- trunk/mapbender/http/frames/cleanurl.php_deprecated (rev 0)
+++ trunk/mapbender/http/frames/cleanurl.php_deprecated 2019-06-06 09:30:35 UTC (rev 10139)
@@ -0,0 +1,50 @@
+<?php
+# $Id: cleanurl.php 6733 2010-08-10 09:38:39Z christoph $
+# 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.
+
+ob_start();
+include_once(dirname(__FILE__) . "/../../conf/mapbender.conf");
+include(dirname(__FILE__) . "/../classes/class_administration.php");
+
+
+$adm = new administration();
+
+$con = db_connect(DBSERVER,OWNER,PW);
+db_select_db(DB,$con);
+
+$id = $_GET['id'];
+
+$sql = "SELECT * FROM mb_meetingpoint WHERE mb_meetingpoint_id = $1";
+$v = array($id);
+$t = array('s');
+$res = db_prep_query($sql,$v,$t);
+if($row = db_fetch_array($res)){
+ $user = $adm->getUserNameByUserId($row['fkey_mb_user_id']);
+ $password = $row['mb_user_password'];
+ $gui_id = $row['fkey_gui_id'];
+}
+else {
+ exit();
+}
+$url = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])."/login.php?";
+$url .= "name=".$user."&password=".urlencode($password)."&mb_user_myGui=".$gui_id."&kml_id=".$id;
+
+header ("Location: ".$url);
+ob_end_flush();
+?>
+</body>
+</html>
Deleted: trunk/mapbender/http/javascripts/mod_initWmc.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_initWmc.php 2019-06-05 16:29:36 UTC (rev 10138)
+++ trunk/mapbender/http/javascripts/mod_initWmc.php 2019-06-06 09:30:35 UTC (rev 10139)
@@ -1,116 +0,0 @@
-<?php
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__) . "/../classes/class_wmc.php");
-require_once(dirname(__FILE__) . "/../classes/class_kml.php");
-require_once(dirname(__FILE__) . "/../classes/class_administration.php");
-
-if (Mapbender::session()->get("mb_myWmc") && Mapbender::session()->get("mb_myWmc_action") &&
- in_array(Mapbender::session()->get("mb_myWmc_action"),
- array("load", "merge", "append"))) {
-
- $action = Mapbender::session()->get("mb_myWmc_action");
- $wmc_id = Mapbender::session()->get("mb_myWmc");
-}
-$user = Mapbender::session()->get("mb_user_id");
-$meetingPointId = Mapbender::session()->get("mb_myKml");
-
-$x = false;
-$y = false;
-$icon = false;
-$alt = false;
-$url = false;
-
-$adm = new administration();
-
-//KML
-if (isset($meetingPointId)) {
- $sql = "SELECT * FROM mb_meetingpoint WHERE mb_meetingpoint_id = $1";
- $v = array($meetingPointId);
- $t = array('s');
- $res = db_prep_query($sql,$v,$t);
- if($row = db_fetch_array($res)){
- $user = $row['fkey_mb_user_id'];
- $password = $row['mb_user_password'];
- $gui = $row['fkey_gui_id'];
- $wmc_id = $row['fkey_wmc_serial_id'];
- $kml_doc = $row['kml'];
-
- $kml = new kml("", "", 0, 0, "");
- $value = $kml->createObjFromKML($kml_doc);
-
- $x = $kml->x;
- $y = $kml->y;
- $icon = $kml->icon;
- if ($kml->title) {
- if ($kml->description) $alt = $kml->title . ", " .$kml->description;
- else $alt = $kml->title;
- }
- else $alt = $kml->description;
-
- if (mb_ereg("^.*,[[:space:]]((([[:alpha:]]+://)|(www.))[^<>[:space:]]+[[:alnum:]/]).*$", $kml->title)) {
- $url = mb_ereg_replace("^.*,[[:space:]]((([[:alpha:]]+://)|(www.))[^<>[:space:]]+[[:alnum:]/]).*$", "\\1", $kml->title);
- if (mb_substr($url, 0, 4) == "www.") {
- $url = "http://" . $url;
- }
- }
- }
- else {
- $js_error .= "alert('Meetingpoint ID id ".$meetingPointId." is not valid. Default GUI will be loaded instead.');";
- }
-}
-
-//WMC
-if (isset($wmc_id)) {
- $myInitWmc = new wmc();
- $success = $myInitWmc->createFromDb($wmc_id);
- if ($success) {
-
- $js_wmc = implode("", $myInitWmc->toJavaScript());
- new mb_exception("WMC JS: " . $js_wmc);
-
- if (!empty($x) && !empty($y) && !empty($icon)) {
-
- $js_kml .= "var myPoint = realToMap('".$e_target[0]."', new Point(".$x.",".$y."));\n";
-
- // 7 is half the width of pin.png
- $js_kml .= "myPoint.x -= 7;";
- // 20 is the height of pin.png
- $js_kml .= "myPoint.y -= 20;";
-
- $js_kml .= "var meetingPointLogoStyle = {'position':'absolute', 'top':0, 'left':0, 'z-index':100, 'font-size':'10px'};\n";
- $js_kml .= "meetingPointLogoTag = new DivTag('meeting_logo', '".$e_target[0]."', meetingPointLogoStyle);\n";
- $js_img .= "<img id='meeting_img' border='0' src='".$icon."' title='".$alt."'>";
- if ($url) {
- $js_img = "<a href='".$url."' target='_blank'>" . $js_img . "</a>";
- }
- $js_kml .= "var meetingPointLogoText = \"" . $js_img . "\";\n";
- $js_kml .= "meetingPointLogoTag.write(meetingPointLogoText);\n";
- $js_kml .= "var meeting_img = window.frames['".$e_target[0]."'].document.getElementById('meeting_img');";
- $js_kml .= "meeting_img.style.position = 'absolute';";
- $js_kml .= "meeting_img.style.top = myPoint.y + 'px';";
- $js_kml .= "meeting_img.style.left = myPoint.x + 'px';";
- $js_kml .= "mb_registerPanSubElement('meeting_logo');";
- }
- }
- else {
- $js_error .= "alert('WMC id ".$wmc_id." is not valid. Default GUI will be loaded instead.');";
- }
-}
-echo "function mod_initWMC_init() {";
-echo $js_wmc;
-echo $js_kml;
-echo $js_error;
-echo "}";
-
-echo "function addFlag() {";
-echo $js_kml;
-echo "}";
-
-
-?>
-
-mb_registerInitFunctions("mod_initWMC()");
-function mod_initWMC(){
- mod_initWMC_init();
- mb_registerSubFunctions('addFlag()');
-}
Added: trunk/mapbender/http/javascripts/mod_initWmc.php_deprecated
===================================================================
--- trunk/mapbender/http/javascripts/mod_initWmc.php_deprecated (rev 0)
+++ trunk/mapbender/http/javascripts/mod_initWmc.php_deprecated 2019-06-06 09:30:35 UTC (rev 10139)
@@ -0,0 +1,116 @@
+<?php
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__) . "/../classes/class_wmc.php");
+require_once(dirname(__FILE__) . "/../classes/class_kml.php");
+require_once(dirname(__FILE__) . "/../classes/class_administration.php");
+
+if (Mapbender::session()->get("mb_myWmc") && Mapbender::session()->get("mb_myWmc_action") &&
+ in_array(Mapbender::session()->get("mb_myWmc_action"),
+ array("load", "merge", "append"))) {
+
+ $action = Mapbender::session()->get("mb_myWmc_action");
+ $wmc_id = Mapbender::session()->get("mb_myWmc");
+}
+$user = Mapbender::session()->get("mb_user_id");
+$meetingPointId = Mapbender::session()->get("mb_myKml");
+
+$x = false;
+$y = false;
+$icon = false;
+$alt = false;
+$url = false;
+
+$adm = new administration();
+
+//KML
+if (isset($meetingPointId)) {
+ $sql = "SELECT * FROM mb_meetingpoint WHERE mb_meetingpoint_id = $1";
+ $v = array($meetingPointId);
+ $t = array('s');
+ $res = db_prep_query($sql,$v,$t);
+ if($row = db_fetch_array($res)){
+ $user = $row['fkey_mb_user_id'];
+ $password = $row['mb_user_password'];
+ $gui = $row['fkey_gui_id'];
+ $wmc_id = $row['fkey_wmc_serial_id'];
+ $kml_doc = $row['kml'];
+
+ $kml = new kml("", "", 0, 0, "");
+ $value = $kml->createObjFromKML($kml_doc);
+
+ $x = $kml->x;
+ $y = $kml->y;
+ $icon = $kml->icon;
+ if ($kml->title) {
+ if ($kml->description) $alt = $kml->title . ", " .$kml->description;
+ else $alt = $kml->title;
+ }
+ else $alt = $kml->description;
+
+ if (mb_ereg("^.*,[[:space:]]((([[:alpha:]]+://)|(www.))[^<>[:space:]]+[[:alnum:]/]).*$", $kml->title)) {
+ $url = mb_ereg_replace("^.*,[[:space:]]((([[:alpha:]]+://)|(www.))[^<>[:space:]]+[[:alnum:]/]).*$", "\\1", $kml->title);
+ if (mb_substr($url, 0, 4) == "www.") {
+ $url = "http://" . $url;
+ }
+ }
+ }
+ else {
+ $js_error .= "alert('Meetingpoint ID id ".$meetingPointId." is not valid. Default GUI will be loaded instead.');";
+ }
+}
+
+//WMC
+if (isset($wmc_id)) {
+ $myInitWmc = new wmc();
+ $success = $myInitWmc->createFromDb($wmc_id);
+ if ($success) {
+
+ $js_wmc = implode("", $myInitWmc->toJavaScript());
+ new mb_exception("WMC JS: " . $js_wmc);
+
+ if (!empty($x) && !empty($y) && !empty($icon)) {
+
+ $js_kml .= "var myPoint = realToMap('".$e_target[0]."', new Point(".$x.",".$y."));\n";
+
+ // 7 is half the width of pin.png
+ $js_kml .= "myPoint.x -= 7;";
+ // 20 is the height of pin.png
+ $js_kml .= "myPoint.y -= 20;";
+
+ $js_kml .= "var meetingPointLogoStyle = {'position':'absolute', 'top':0, 'left':0, 'z-index':100, 'font-size':'10px'};\n";
+ $js_kml .= "meetingPointLogoTag = new DivTag('meeting_logo', '".$e_target[0]."', meetingPointLogoStyle);\n";
+ $js_img .= "<img id='meeting_img' border='0' src='".$icon."' title='".$alt."'>";
+ if ($url) {
+ $js_img = "<a href='".$url."' target='_blank'>" . $js_img . "</a>";
+ }
+ $js_kml .= "var meetingPointLogoText = \"" . $js_img . "\";\n";
+ $js_kml .= "meetingPointLogoTag.write(meetingPointLogoText);\n";
+ $js_kml .= "var meeting_img = window.frames['".$e_target[0]."'].document.getElementById('meeting_img');";
+ $js_kml .= "meeting_img.style.position = 'absolute';";
+ $js_kml .= "meeting_img.style.top = myPoint.y + 'px';";
+ $js_kml .= "meeting_img.style.left = myPoint.x + 'px';";
+ $js_kml .= "mb_registerPanSubElement('meeting_logo');";
+ }
+ }
+ else {
+ $js_error .= "alert('WMC id ".$wmc_id." is not valid. Default GUI will be loaded instead.');";
+ }
+}
+echo "function mod_initWMC_init() {";
+echo $js_wmc;
+echo $js_kml;
+echo $js_error;
+echo "}";
+
+echo "function addFlag() {";
+echo $js_kml;
+echo "}";
+
+
+?>
+
+mb_registerInitFunctions("mod_initWMC()");
+function mod_initWMC(){
+ mod_initWMC_init();
+ mb_registerSubFunctions('addFlag()');
+}
Deleted: trunk/mapbender/http/javascripts/mod_insertKmlIntoDb.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_insertKmlIntoDb.php 2019-06-05 16:29:36 UTC (rev 10138)
+++ trunk/mapbender/http/javascripts/mod_insertKmlIntoDb.php 2019-06-06 09:30:35 UTC (rev 10139)
@@ -1,98 +0,0 @@
-<?php
-#$Id$
-#$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");
-include(dirname(__FILE__) . "/../classes/class_kml.php");
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
-<html>
-<head>
-<!--
-Licensing: See the GNU General Public License for more details.
-http://www.gnu.org/copyleft/gpl.html
-or:
-mapbender/licence/
--->
-
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
-?>
-<title>MB2 - <?php echo $gui_id;?></title>
-</head>
-<body>
-<?php
-if ($_POST["data"]) {
-
- $d = explode("____", $_POST["data"]);
- $wmc_id = $d[0];
- $x = $d[1];
- $y = $d[2];
- $icon = $d[3];
- $gui_id = $d[4];
- $title_array = array();
- if ($_POST['name']) $title_array[count($title_array)] = $_POST['name'];
- if ($_POST['street']) $title_array[count($title_array)] = $_POST['street'];
- if ($_POST['postcode']) {
- if ($_POST['city']) {
- $title_array[count($title_array)] = $_POST['postcode'] . " " . $_POST['city'];
- }
- else {
- $title_array[count($title_array)] = $_POST['postcode'];
- }
- }
- elseif ($_POST['city']) {
- $title_array[count($title_array)] = $_POST['city'];
- }
- if ($_POST['website']) $title_array[count($title_array)] = $_POST['website'];
-
- $title = implode(", ", $title_array);
- $description = $_POST['description'];
-
- $kml = new kml($title, $description, $x, $y, $icon);
- $kml->createKMLFromObj();
-
- $sql = "INSERT INTO mb_meetingpoint VALUES ($1, $2, $3, $4, $5, $6)";
- $v = array($kml->kml_id, $wmc_id, preg_replace("/&/", "&" , html_entity_decode($kml->kml)), Mapbender::session()->get("mb_user_id"), Mapbender::session()->get("mb_user_password"), $gui_id);
- $t = array('s', 's', 's', 'i', 's', 's');
- $res = db_prep_query($sql, $v, $t);
-
- if (db_error()) {
- echo "<script>var title = \"" . $title . "\";alert(\"Error while saving KML document \" + title + \"! ".db_error()."\");</script>";
- }
- else {
- if ($alert) {
- echo "<script>var title = \"" . $title . "\";alert(\"KML document \" + title + \"has been saved!\")</script>";
- }
- }
- $filename = "../tmp/".$kml->kml_id.'.kml';
- $handle = fopen($filename, "w");
- fputs($handle, preg_replace("/&/", "&" , html_entity_decode($kml->kml)));
- fclose($handle);
-
- echo "Please feel free to add the <a href = 'http://".$_SERVER['HTTP_HOST']."/mburl/".$kml->kml_id."'>link</a> to your meeting point to your website.<br><br>";
- echo "<a href='".$filename."'>kml</a>";
-}
-?>
-
-</body>
-</html>
Added: trunk/mapbender/http/javascripts/mod_insertKmlIntoDb.php_deprecated
===================================================================
--- trunk/mapbender/http/javascripts/mod_insertKmlIntoDb.php_deprecated (rev 0)
+++ trunk/mapbender/http/javascripts/mod_insertKmlIntoDb.php_deprecated 2019-06-06 09:30:35 UTC (rev 10139)
@@ -0,0 +1,98 @@
+<?php
+#$Id: mod_insertKmlIntoDb.php 4226 2009-06-25 11:50:57Z vera $
+#$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");
+include(dirname(__FILE__) . "/../classes/class_kml.php");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<!--
+Licensing: See the GNU General Public License for more details.
+http://www.gnu.org/copyleft/gpl.html
+or:
+mapbender/licence/
+-->
+
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<title>MB2 - <?php echo $gui_id;?></title>
+</head>
+<body>
+<?php
+if ($_POST["data"]) {
+
+ $d = explode("____", $_POST["data"]);
+ $wmc_id = $d[0];
+ $x = $d[1];
+ $y = $d[2];
+ $icon = $d[3];
+ $gui_id = $d[4];
+ $title_array = array();
+ if ($_POST['name']) $title_array[count($title_array)] = $_POST['name'];
+ if ($_POST['street']) $title_array[count($title_array)] = $_POST['street'];
+ if ($_POST['postcode']) {
+ if ($_POST['city']) {
+ $title_array[count($title_array)] = $_POST['postcode'] . " " . $_POST['city'];
+ }
+ else {
+ $title_array[count($title_array)] = $_POST['postcode'];
+ }
+ }
+ elseif ($_POST['city']) {
+ $title_array[count($title_array)] = $_POST['city'];
+ }
+ if ($_POST['website']) $title_array[count($title_array)] = $_POST['website'];
+
+ $title = implode(", ", $title_array);
+ $description = $_POST['description'];
+
+ $kml = new kml($title, $description, $x, $y, $icon);
+ $kml->createKMLFromObj();
+
+ $sql = "INSERT INTO mb_meetingpoint VALUES ($1, $2, $3, $4, $5, $6)";
+ $v = array($kml->kml_id, $wmc_id, preg_replace("/&/", "&" , html_entity_decode($kml->kml)), Mapbender::session()->get("mb_user_id"), Mapbender::session()->get("mb_user_password"), $gui_id);
+ $t = array('s', 's', 's', 'i', 's', 's');
+ $res = db_prep_query($sql, $v, $t);
+
+ if (db_error()) {
+ echo "<script>var title = \"" . $title . "\";alert(\"Error while saving KML document \" + title + \"! ".db_error()."\");</script>";
+ }
+ else {
+ if ($alert) {
+ echo "<script>var title = \"" . $title . "\";alert(\"KML document \" + title + \"has been saved!\")</script>";
+ }
+ }
+ $filename = "../tmp/".$kml->kml_id.'.kml';
+ $handle = fopen($filename, "w");
+ fputs($handle, preg_replace("/&/", "&" , html_entity_decode($kml->kml)));
+ fclose($handle);
+
+ echo "Please feel free to add the <a href = 'http://".$_SERVER['HTTP_HOST']."/mburl/".$kml->kml_id."'>link</a> to your meeting point to your website.<br><br>";
+ echo "<a href='".$filename."'>kml</a>";
+}
+?>
+
+</body>
+</html>
Deleted: trunk/mapbender/http/javascripts/mod_saveWmcKml.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_saveWmcKml.php 2019-06-05 16:29:36 UTC (rev 10138)
+++ trunk/mapbender/http/javascripts/mod_saveWmcKml.php 2019-06-06 09:30:35 UTC (rev 10139)
@@ -1,108 +0,0 @@
-<?php
-# $Id: mod_savewmc.php 264 2006-05-12 11:07:19Z vera_schulze
-# http://www.mapbender.org/index.php/mod_savewmc.php
-# 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");
-echo "mod_savewmc_target = '".$e_target[0]."';";
-?>
-
-var mod_savewmc_img = new Image(); mod_savewmc_img.src = "<?php echo $e_src; ?>";
-//var mod_savewmc_img_over = new Image(); mod_savewmc_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
-
-function mod_saveWmcKml(obj){
- current_user = "<?php echo Mapbender::session()->get("mb_user_id"); ?>";
- current_password = "<?php echo Mapbender::session()->get("mb_user_password");?>";
- current_gui = "<?php echo $gui_id;?>";
-
- alert('Please set the meeting point by clicking the map.');
-
- var ind = getMapObjIndexByName(mod_savewmc_target);
-
- var el = frames[mod_savewmc_target].document;
- el.onmousedown = mod_getMousePos;
- el.onmouseup = null;
- el.onmousemove = null;
- el.onmouseover = null;
-}
-
-function mod_getMousePos(e) {
- mb_getMousePos(e,mod_savewmc_target);
- var q = new Point(clickX,clickY);
- var realWorldPos = mapToReal(mod_savewmc_target,q);
-
- var el = frames[mod_savewmc_target].document;
- el.onmousedown = null;
- //alert(realWorldPos);
- //document.sendData.target = "_blank";
- //document.sendData.action = "../javascripts/mod_insertWmcIntoDb.php";
- //document.sendData.data.value = user + "____" + generalTitle + "____" + wmc + "____" + id;
- //document.sendData.submit();
-
- saveWindow = open("", "save", "width=400, height=300, resizable, dependent=yes, scrollbars=yes");
- saveWindow.document.open("text/html");
-/*
- var cssLink = saveWindow.document.createElement("link");
- cssLink.setAttribute("href", wfsCssUrl);
- cssLink.setAttribute("type", "text/css");
- cssLink.setAttribute("rel", "stylesheet");
- var cssTmp = saveWindow.document.getElementsByTagName("head")[0];
- cssTmp.appendChild(cssLink);
-*/
- var wmc_title = "meetingpoint";
- var icon = "http://wms1.ccgis.de/mapbender_dev/img/pin.png";
-
- var str = "";
- var onclick = "wmcid=window.opener.mod_savewmc('"+wmc_title+"');";
- onclick += "document.sendData.action = '../javascripts/mod_insertKmlIntoDb.php?<?php echo SID;?>';";
- onclick += "document.sendData.data.value = wmcid + '____" + realWorldPos.x + "____" + realWorldPos.y + "____"+ icon + "____<?php echo $gui_id;?>';";
- onclick += "document.sendData.submit();"
- str += "<form name='sendData' method='post'>\n";
- str += "<table>\n";
- str += "<tr>\n";
- str += "<td>Name</td>\n";
- str += "<td><input type='text' name='name'></td>\n";
- str += "</tr>\n";
- str += "<tr>\n";
- str += "<td>Strasse</td>\n";
- str += "<td><input type='text' name='street'></td>\n";
- str += "</tr>\n";
- str += "<tr>\n";
- str += "<td>PLZ</td>\n";
- str += "<td><input type='text' name='postcode'></td>\n";
- str += "</tr>\n";
- str += "<tr>\n";
- str += "<td>Ort</td>\n";
- str += "<td><input type='text' name='city'></td>\n";
- str += "</tr>\n";
- str += "<tr>\n";
- str += "<td>Webseite</td>\n";
- str += "<td><input type='text' name='website'></td>\n";
- str += "</tr>\n";
- str += "<tr>\n";
- str += "<td>Beschreibung</td>\n";
- str += "<td><textarea name='description'></textarea></td>\n";
- str += "</tr>\n";
- str += "<tr>\n";
- str += "<td colspan=2><input type='button' value='URL generieren' name='generateUrl' onclick=\""+onclick+"\"></td>\n";
- str += "</tr>\n";
- str += "</table>\n";
- str += "<input type=hidden name=data>\n";
- str += "</form>";
- saveWindow.document.write(str);
- saveWindow.document.close();
-}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_saveWmcKml.php_deprecated
===================================================================
--- trunk/mapbender/http/javascripts/mod_saveWmcKml.php_deprecated (rev 0)
+++ trunk/mapbender/http/javascripts/mod_saveWmcKml.php_deprecated 2019-06-06 09:30:35 UTC (rev 10139)
@@ -0,0 +1,108 @@
+<?php
+# $Id: mod_savewmc.php 264 2006-05-12 11:07:19Z vera_schulze
+# http://www.mapbender.org/index.php/mod_savewmc.php
+# 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");
+echo "mod_savewmc_target = '".$e_target[0]."';";
+?>
+
+var mod_savewmc_img = new Image(); mod_savewmc_img.src = "<?php echo $e_src; ?>";
+//var mod_savewmc_img_over = new Image(); mod_savewmc_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+function mod_saveWmcKml(obj){
+ current_user = "<?php echo Mapbender::session()->get("mb_user_id"); ?>";
+ current_password = "<?php echo Mapbender::session()->get("mb_user_password");?>";
+ current_gui = "<?php echo $gui_id;?>";
+
+ alert('Please set the meeting point by clicking the map.');
+
+ var ind = getMapObjIndexByName(mod_savewmc_target);
+
+ var el = frames[mod_savewmc_target].document;
+ el.onmousedown = mod_getMousePos;
+ el.onmouseup = null;
+ el.onmousemove = null;
+ el.onmouseover = null;
+}
+
+function mod_getMousePos(e) {
+ mb_getMousePos(e,mod_savewmc_target);
+ var q = new Point(clickX,clickY);
+ var realWorldPos = mapToReal(mod_savewmc_target,q);
+
+ var el = frames[mod_savewmc_target].document;
+ el.onmousedown = null;
+ //alert(realWorldPos);
+ //document.sendData.target = "_blank";
+ //document.sendData.action = "../javascripts/mod_insertWmcIntoDb.php";
+ //document.sendData.data.value = user + "____" + generalTitle + "____" + wmc + "____" + id;
+ //document.sendData.submit();
+
+ saveWindow = open("", "save", "width=400, height=300, resizable, dependent=yes, scrollbars=yes");
+ saveWindow.document.open("text/html");
+/*
+ var cssLink = saveWindow.document.createElement("link");
+ cssLink.setAttribute("href", wfsCssUrl);
+ cssLink.setAttribute("type", "text/css");
+ cssLink.setAttribute("rel", "stylesheet");
+ var cssTmp = saveWindow.document.getElementsByTagName("head")[0];
+ cssTmp.appendChild(cssLink);
+*/
+ var wmc_title = "meetingpoint";
+ var icon = "http://wms1.ccgis.de/mapbender_dev/img/pin.png";
+
+ var str = "";
+ var onclick = "wmcid=window.opener.mod_savewmc('"+wmc_title+"');";
+ onclick += "document.sendData.action = '../javascripts/mod_insertKmlIntoDb.php?<?php echo SID;?>';";
+ onclick += "document.sendData.data.value = wmcid + '____" + realWorldPos.x + "____" + realWorldPos.y + "____"+ icon + "____<?php echo $gui_id;?>';";
+ onclick += "document.sendData.submit();"
+ str += "<form name='sendData' method='post'>\n";
+ str += "<table>\n";
+ str += "<tr>\n";
+ str += "<td>Name</td>\n";
+ str += "<td><input type='text' name='name'></td>\n";
+ str += "</tr>\n";
+ str += "<tr>\n";
+ str += "<td>Strasse</td>\n";
+ str += "<td><input type='text' name='street'></td>\n";
+ str += "</tr>\n";
+ str += "<tr>\n";
+ str += "<td>PLZ</td>\n";
+ str += "<td><input type='text' name='postcode'></td>\n";
+ str += "</tr>\n";
+ str += "<tr>\n";
+ str += "<td>Ort</td>\n";
+ str += "<td><input type='text' name='city'></td>\n";
+ str += "</tr>\n";
+ str += "<tr>\n";
+ str += "<td>Webseite</td>\n";
+ str += "<td><input type='text' name='website'></td>\n";
+ str += "</tr>\n";
+ str += "<tr>\n";
+ str += "<td>Beschreibung</td>\n";
+ str += "<td><textarea name='description'></textarea></td>\n";
+ str += "</tr>\n";
+ str += "<tr>\n";
+ str += "<td colspan=2><input type='button' value='URL generieren' name='generateUrl' onclick=\""+onclick+"\"></td>\n";
+ str += "</tr>\n";
+ str += "</table>\n";
+ str += "<input type=hidden name=data>\n";
+ str += "</form>";
+ saveWindow.document.write(str);
+ saveWindow.document.close();
+}
Deleted: trunk/mapbender/http/php/mod_meetingPoint.php
===================================================================
--- trunk/mapbender/http/php/mod_meetingPoint.php 2019-06-05 16:29:36 UTC (rev 10138)
+++ trunk/mapbender/http/php/mod_meetingPoint.php 2019-06-06 09:30:35 UTC (rev 10139)
@@ -1,360 +0,0 @@
-<?PHP
-# $Id$
-# http://www.mapbender.org/index.php/MeetingPoint
-# 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");
-
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>meetingPoint</title>
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET;?>">
-<?php
-include '../include/dyn_css.php';
-?>
-<script type="text/javascript">
-<!--
-<?php
-include('../include/dyn_js.php');
-echo "var mod_meetingPoint_target = '" . $_REQUEST["e_target"] . "';";
-echo "var meetingPoint_write_to = 'meetingPoint';";
-?>
-
-// causes an error, read for discussion: http://stackoverflow.com/questions/1007340/javascript-function-aliasing-doesnt-seem-to-work
-// window.alert = parent.alert;
-
-try{
- if (meetingPoint_export_subject){}
-}
-catch(e){
- meetingPoint_export_subject = '<?php echo _mb("Your meeting point. Follow the link!") ?>';
-}
-
-try{
- if (meetingPoint_export_url){}
-}
-catch(e){
- meetingPoint_export_url = '';
-}
-
-try{
- if (meetingPoint_export_format){}
-}
-catch(e){
- meetingPoint_export_format = 'prompt';
-}
-
-try{
- if (meetingPoint_max_characters){}
-}
-catch(e){
- meetingPoint_max_characters = 100;
-}
-
-try{
- if (meetingPoint_image){}
-}
-catch(e){
- meetingPoint_image = "../img/button_digitize/point_off.png";
-}
-
-try{
- if (meetingPoint_icon){}
-}
-catch(e){
- meetingPoint_icon = '../img/redball.gif';
-}
-
-try{
- if (meetingPoint_width){}
-}
-catch(e){
- meetingPoint_width = 14;
-}
-
-try{
- if (meetingPoint_height){}
-}
-catch(e){
- meetingPoint_height = 14;
-}
-
-try{
- if (meetingPoint_style){}
-}
-catch(e){
- meetingPoint_style = 'background-color:white;font-weight: bold;color:black;font-family:Arial;';
-}
-
-try{
- if (meetingPoint_please_click){}
-}
-catch(e){
- meetingPoint_please_click = '<?php echo _mb("Please click for the meeting point position!") ?>';
-}
-
-var mod_meetingPointRealPoint = null;
-//parent.mb_registerSubFunctions("window.frames['meetingPoint'].mod_meetingPoint_draw()");
-
-parent.eventAfterMapRequest.register(function () {
- mod_meetingPoint_draw();
-});
-
-var ie = document.all?1:0;
-var mod_meetingPoint_win = null;
-var mod_meetingPoint_elName = "meetingPoint";
-var mod_meetingPoint_frameName = "meetingPoint";
-var mod_meetingPoint_button = "my_getCoords";
-var mod_meetingPoint_img_on = new Image(); mod_meetingPoint_img_on.src = meetingPoint_image.replace(/_off/,"_on") ;
-var mod_meetingPoint_img_off = new Image(); mod_meetingPoint_img_off.src = meetingPoint_image;
-var mod_meetingPoint_img_over = new Image(); mod_meetingPoint_img_over.src = meetingPoint_image.replace(/_off/,"_over") ;
-var mod_meetingPoint_fix = "";
-
-
-function init_mod_meetingPoint(ind){
- parent.mb_button[ind] = window.document.getElementById(mod_meetingPoint_button);
- parent.mb_button[ind].img_over = mod_meetingPoint_img_over.src;
- parent.mb_button[ind].img_on = mod_meetingPoint_img_on.src;
- parent.mb_button[ind].img_off = mod_meetingPoint_img_off.src;
- parent.mb_button[ind].status = 0;
- parent.mb_button[ind].elName = mod_meetingPoint_button;
- parent.mb_button[ind].go = new Function ("mod_meetingPoint_run()");
- parent.mb_button[ind].stop = new Function ("mod_meetingPoint_disable()");
-}
-
-var mod_meetingPoint_getMousePosition = function (e) {
- var mapObject = parent.getMapObjByName(mod_meetingPoint_target);
- var clickPos = mapObject.getMousePosition(e);
- mod_meetingPointRealPoint = mapObject.convertPixelToReal(clickPos);
- mod_meetingPoint_write(mod_meetingPointRealPoint.x, mod_meetingPointRealPoint.y);
- mod_meetingPoint_draw();
- parent.mb_disableThisButton(mod_meetingPoint_button);
-};
-
-function mod_meetingPoint_run(){
- if (document.forms[0].mytext.value === "") {
- alert("<?php echo _mb("Please define a text!") ?>");
- parent.mb_disableThisButton(mod_meetingPoint_button);
- return;
- }
- var mapObject = parent.getMapObjByName(mod_meetingPoint_target);
- if (mapObject) {
- parent.$(mapObject.getDomElement()).bind("click", mod_meetingPoint_getMousePosition);
- }
-}
-
-function mod_meetingPoint_disable(){
- var mapObject = parent.getMapObjByName(mod_meetingPoint_target);
- if (mapObject) {
- parent.$(mapObject.getDomElement()).unbind("click", mod_meetingPoint_getMousePosition);
- }
-}
-
-function mod_meetingPoint_write(x,y){
- document.forms[0].x.value =x;
- document.forms[0].y.value =y;
-}
-
-function mod_meetingPoint_hide(){
- var mapObject = parent.getMapObjByName(mod_meetingPoint_target);
- var map_el = mapObject.getDomElement();
- parent.$(parent.document.getElementById(mapObject.elementName + "_meetingPoint_permanent")).empty();
-}
-
-
-function mod_meetingPoint_draw(){
- var splitext = document.forms[0].mytext.value;
- document.forms[0].mytext.value = splitext.substring(0, meetingPoint_max_characters);
-
- var mapObject = parent.getMapObjByName(mod_meetingPoint_target);
- if (mapObject) {
- if (mod_meetingPointRealPoint !== null) {
- //alert(document.forms[0].x.value +" -- "+ document.forms[0].y.value + " - " );
-
- var meetingPointClickPos = mapObject.convertRealToPixel(mod_meetingPointRealPoint);
- var tagSource = "";
- tagSource += "<div style='visibility:visible;z-index:105;position:absolute;left:"+
- (meetingPointClickPos.x- Math.round(0.5*meetingPoint_width))+"px;top:"+
- (meetingPointClickPos.y-Math.round(0.5*meetingPoint_height))+"px'>";
- tagSource += "<img src='"+meetingPoint_icon+"' />";
- tagSource += "<div class='ui-widget-content ui-corner-all' style='padding:3px'><span style='white-space:nowrap;'>"+document.forms[0].mytext.value.replace("\n", "<br>")+"</span></div>";
- tagSource += "</div>";
-
- var map_el = mapObject.getDomElement();
- if (!map_el.ownerDocument.getElementById(mapObject.elementName + "_meetingPoint_permanent")) {
-
- //create Box Elements
- var $div = parent.$("<div id='" + mapObject.elementName + "_meetingPoint_permanent'></div>");
- $div.css({
- position: "absolute",
- top: "0px",
- left: "0px"
- });
- parent.$(map_el).append($div);
- parent.mb_registerPanSubElement(mapObject.elementName + "_meetingPoint_permanent")
- }
- parent.$(parent.document.getElementById(mapObject.elementName + "_meetingPoint_permanent")).html(tagSource);
- }
- }
-}
-
-/* Check max character value*/
-
-function checkMaxCharacters() {
- var stringLength = document.forms[0].mytext.value.length;
- if (stringLength > meetingPoint_max_characters) {
- document.forms[0].mytext.value = document.forms[0].mytext.value.slice(0, meetingPoint_max_characters) ;
- alert("<?php echo _mb("Input too long. Maximum of allowed characters is"); ?> " + meetingPoint_max_characters);
- }
-}
-
-function setMaxCharacterTitle() {
- var maxCharacterString = "<?php echo _mb("Max characters") ?>: " + meetingPoint_max_characters;
-// document.getElementById("mytext").title = maxCharacterString;
- document.getElementById("mytext").setAttribute("title",maxCharacterString);
-// document.forms[0].mytext.title = maxCharacterString;
-}
-
--->
-</script>
-
-<script language='JavaScript'>
-<!--
-<?php
-echo "var used_charset = '".CHARSET ."';";
-?>
-
-function validate(){
- var mycheck = true;
- var checkObj= document.forms[0].mytext;
- if(checkObj.value == '') {
- alert ("<?php echo _mb("Please define a text!") ?>");
- checkObj.focus();
- mycheck=false;
- return false;
- }
-
- var checkObj= document.forms[0].x;
- if(checkObj.value == '') {
- alert (meetingPoint_please_click);
- mycheck = false;
- }
-
- if(mycheck == true){
- if(meetingPoint_export_url != "") {
- my_meetingPoint = meetingPoint_export_url + "?";
- }
- else {
- my_meetingPoint = document.forms[0].myurl.value + "?";
- }
- my_meetingPoint += "name=" + encodeURIComponent(document.forms[0].myuser.value);
- my_meetingPoint += "&password=" + encodeURIComponent(document.forms[0].mypw.value);
- my_meetingPoint += "&mb_user_myGui=" + encodeURIComponent(document.forms[0].mygui.value);
-
- var ind = parent.getMapObjIndexByName('mapframe1');
- var coord = parent.mb_mapObj[ind].extent.toString().split(",");
-
- my_meetingPoint += "&mb_myBBOX=" + parseFloat(coord[0]) + ",";
- my_meetingPoint += parseFloat(coord[1]) + ",";
- my_meetingPoint += parseFloat(coord[2]) + ",";
- my_meetingPoint += parseFloat(coord[3]) ;
-
- my_meetingPoint += "&mb_myPOI=";
-
- var splitext = document.forms[0].mytext.value;
- document.forms[0].mytext.value = splitext.substring(0, meetingPoint_max_characters);
-
- my_meetingPoint += encodeURIComponent(document.forms[0].mytext.value);
-
- my_meetingPoint += "___" + document.forms[0].x.value + "___";
- my_meetingPoint += document.forms[0].y.value;
-
- if(meetingPoint_export_format == 'email') {
- createEmail(my_meetingPoint,meetingPoint_export_subject);
- }
- else {
- var div = parent.$("<div/>").attr("title", "Treffpunkt").text(meetingPoint_export_subject);
- var textarea = parent.$("<textarea />").attr({
- "rows": 5,
- "cols": 30
- }).text(my_meetingPoint);
- div.append("<br /><br />");
- div.append(textarea);
- div.dialog();
- // prompt(meetingPoint_export_subject,my_meetingPoint);
- }
- }
-}
-
-function emptyfields(){
- document.forms[0].mytext.value ='';
- document.forms[0].x.value ='';
- document.forms[0].y.value = '';
- mod_meetingPoint_hide();
-}
-
-function createEmail (url,subject) {
- var email = "mailto:"
- email += "";
- email += "?subject=";
- email += subject;
- email += "&body=";
- email += escape(url);
-
- var win = window.open(email, 'email', 'top=120,left=120');
- win.close();
-}
-
-function goBack(where){
- document.location.href=where;
-}
-
-function init(){
- parent.mb_regButton_frame("init_mod_meetingPoint","meetingPoint",null);
-}
-
--->
-</script>
-
-</head>
-<body onload="setMaxCharacterTitle()">
-
-<form action="" >
-
-<input class='strinput' type="hidden" name='myurl' value='<?php echo LOGIN; ?>'>
-
-<input class='strinput' type="hidden" name='mygui' value='<?php echo Mapbender::session()->get("mb_user_gui"); ?>'>
-
-<input class='strinput' type="hidden" name='myuser' value='<?php echo Mapbender::session()->get("mb_user_name"); ?>'>
-
-<input class='strinput' type="hidden" name='mypw' value='<?php echo Mapbender::session()->get("mb_user_password"); ?>'>
-<!--<input class='strinput' type="textarea" size=2 name='mytext' value='' "maxlength=70" title="max. 70 Zeichen">-->
-<textarea class='strinput' rows="3" name='mytext' id='mytext' onmouseover='checkMaxCharacters()' title='' onkeyup='checkMaxCharacters()'></textarea>
-<br><br>
-<img id='my_getCoords' name='my_getCoords' onclick="mod_meetingPoint_run()" onmouseover ="parent.mb_regButton_frame('init_mod_meetingPoint','meetingPoint',null)" title="Treffpunkt setzen" src = '../img/button_digitize/point_off.png'>
-<br><br>
-<input class="okbutton" name="Send" type="button" value="ok" onclick="validate();">
-<input class="ibutton" type="button" value="<?php echo _mb("cancel") ?>" onClick="emptyfields();">
-<br>
-<input class="coord" type="hidden" name='x' value='' readonly>
-<input class="coord" type="hidden" name='y' value='' readonly>
-<br>
-</form>
-</body>
-</html>
Added: trunk/mapbender/http/php/mod_meetingPoint.php_deprecated
===================================================================
--- trunk/mapbender/http/php/mod_meetingPoint.php_deprecated (rev 0)
+++ trunk/mapbender/http/php/mod_meetingPoint.php_deprecated 2019-06-06 09:30:35 UTC (rev 10139)
@@ -0,0 +1,360 @@
+<?PHP
+# $Id$
+# http://www.mapbender.org/index.php/MeetingPoint
+# 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");
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>meetingPoint</title>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET;?>">
+<?php
+include '../include/dyn_css.php';
+?>
+<script type="text/javascript">
+<!--
+<?php
+include('../include/dyn_js.php');
+echo "var mod_meetingPoint_target = '" . $_REQUEST["e_target"] . "';";
+echo "var meetingPoint_write_to = 'meetingPoint';";
+?>
+
+// causes an error, read for discussion: http://stackoverflow.com/questions/1007340/javascript-function-aliasing-doesnt-seem-to-work
+// window.alert = parent.alert;
+
+try{
+ if (meetingPoint_export_subject){}
+}
+catch(e){
+ meetingPoint_export_subject = '<?php echo _mb("Your meeting point. Follow the link!") ?>';
+}
+
+try{
+ if (meetingPoint_export_url){}
+}
+catch(e){
+ meetingPoint_export_url = '';
+}
+
+try{
+ if (meetingPoint_export_format){}
+}
+catch(e){
+ meetingPoint_export_format = 'prompt';
+}
+
+try{
+ if (meetingPoint_max_characters){}
+}
+catch(e){
+ meetingPoint_max_characters = 100;
+}
+
+try{
+ if (meetingPoint_image){}
+}
+catch(e){
+ meetingPoint_image = "../img/button_digitize/point_off.png";
+}
+
+try{
+ if (meetingPoint_icon){}
+}
+catch(e){
+ meetingPoint_icon = '../img/redball.gif';
+}
+
+try{
+ if (meetingPoint_width){}
+}
+catch(e){
+ meetingPoint_width = 14;
+}
+
+try{
+ if (meetingPoint_height){}
+}
+catch(e){
+ meetingPoint_height = 14;
+}
+
+try{
+ if (meetingPoint_style){}
+}
+catch(e){
+ meetingPoint_style = 'background-color:white;font-weight: bold;color:black;font-family:Arial;';
+}
+
+try{
+ if (meetingPoint_please_click){}
+}
+catch(e){
+ meetingPoint_please_click = '<?php echo _mb("Please click for the meeting point position!") ?>';
+}
+
+var mod_meetingPointRealPoint = null;
+//parent.mb_registerSubFunctions("window.frames['meetingPoint'].mod_meetingPoint_draw()");
+
+parent.eventAfterMapRequest.register(function () {
+ mod_meetingPoint_draw();
+});
+
+var ie = document.all?1:0;
+var mod_meetingPoint_win = null;
+var mod_meetingPoint_elName = "meetingPoint";
+var mod_meetingPoint_frameName = "meetingPoint";
+var mod_meetingPoint_button = "my_getCoords";
+var mod_meetingPoint_img_on = new Image(); mod_meetingPoint_img_on.src = meetingPoint_image.replace(/_off/,"_on") ;
+var mod_meetingPoint_img_off = new Image(); mod_meetingPoint_img_off.src = meetingPoint_image;
+var mod_meetingPoint_img_over = new Image(); mod_meetingPoint_img_over.src = meetingPoint_image.replace(/_off/,"_over") ;
+var mod_meetingPoint_fix = "";
+
+
+function init_mod_meetingPoint(ind){
+ parent.mb_button[ind] = window.document.getElementById(mod_meetingPoint_button);
+ parent.mb_button[ind].img_over = mod_meetingPoint_img_over.src;
+ parent.mb_button[ind].img_on = mod_meetingPoint_img_on.src;
+ parent.mb_button[ind].img_off = mod_meetingPoint_img_off.src;
+ parent.mb_button[ind].status = 0;
+ parent.mb_button[ind].elName = mod_meetingPoint_button;
+ parent.mb_button[ind].go = new Function ("mod_meetingPoint_run()");
+ parent.mb_button[ind].stop = new Function ("mod_meetingPoint_disable()");
+}
+
+var mod_meetingPoint_getMousePosition = function (e) {
+ var mapObject = parent.getMapObjByName(mod_meetingPoint_target);
+ var clickPos = mapObject.getMousePosition(e);
+ mod_meetingPointRealPoint = mapObject.convertPixelToReal(clickPos);
+ mod_meetingPoint_write(mod_meetingPointRealPoint.x, mod_meetingPointRealPoint.y);
+ mod_meetingPoint_draw();
+ parent.mb_disableThisButton(mod_meetingPoint_button);
+};
+
+function mod_meetingPoint_run(){
+ if (document.forms[0].mytext.value === "") {
+ alert("<?php echo _mb("Please define a text!") ?>");
+ parent.mb_disableThisButton(mod_meetingPoint_button);
+ return;
+ }
+ var mapObject = parent.getMapObjByName(mod_meetingPoint_target);
+ if (mapObject) {
+ parent.$(mapObject.getDomElement()).bind("click", mod_meetingPoint_getMousePosition);
+ }
+}
+
+function mod_meetingPoint_disable(){
+ var mapObject = parent.getMapObjByName(mod_meetingPoint_target);
+ if (mapObject) {
+ parent.$(mapObject.getDomElement()).unbind("click", mod_meetingPoint_getMousePosition);
+ }
+}
+
+function mod_meetingPoint_write(x,y){
+ document.forms[0].x.value =x;
+ document.forms[0].y.value =y;
+}
+
+function mod_meetingPoint_hide(){
+ var mapObject = parent.getMapObjByName(mod_meetingPoint_target);
+ var map_el = mapObject.getDomElement();
+ parent.$(parent.document.getElementById(mapObject.elementName + "_meetingPoint_permanent")).empty();
+}
+
+
+function mod_meetingPoint_draw(){
+ var splitext = document.forms[0].mytext.value;
+ document.forms[0].mytext.value = splitext.substring(0, meetingPoint_max_characters);
+
+ var mapObject = parent.getMapObjByName(mod_meetingPoint_target);
+ if (mapObject) {
+ if (mod_meetingPointRealPoint !== null) {
+ //alert(document.forms[0].x.value +" -- "+ document.forms[0].y.value + " - " );
+
+ var meetingPointClickPos = mapObject.convertRealToPixel(mod_meetingPointRealPoint);
+ var tagSource = "";
+ tagSource += "<div style='visibility:visible;z-index:105;position:absolute;left:"+
+ (meetingPointClickPos.x- Math.round(0.5*meetingPoint_width))+"px;top:"+
+ (meetingPointClickPos.y-Math.round(0.5*meetingPoint_height))+"px'>";
+ tagSource += "<img src='"+meetingPoint_icon+"' />";
+ tagSource += "<div class='ui-widget-content ui-corner-all' style='padding:3px'><span style='white-space:nowrap;'>"+document.forms[0].mytext.value.replace("\n", "<br>")+"</span></div>";
+ tagSource += "</div>";
+
+ var map_el = mapObject.getDomElement();
+ if (!map_el.ownerDocument.getElementById(mapObject.elementName + "_meetingPoint_permanent")) {
+
+ //create Box Elements
+ var $div = parent.$("<div id='" + mapObject.elementName + "_meetingPoint_permanent'></div>");
+ $div.css({
+ position: "absolute",
+ top: "0px",
+ left: "0px"
+ });
+ parent.$(map_el).append($div);
+ parent.mb_registerPanSubElement(mapObject.elementName + "_meetingPoint_permanent")
+ }
+ parent.$(parent.document.getElementById(mapObject.elementName + "_meetingPoint_permanent")).html(tagSource);
+ }
+ }
+}
+
+/* Check max character value*/
+
+function checkMaxCharacters() {
+ var stringLength = document.forms[0].mytext.value.length;
+ if (stringLength > meetingPoint_max_characters) {
+ document.forms[0].mytext.value = document.forms[0].mytext.value.slice(0, meetingPoint_max_characters) ;
+ alert("<?php echo _mb("Input too long. Maximum of allowed characters is"); ?> " + meetingPoint_max_characters);
+ }
+}
+
+function setMaxCharacterTitle() {
+ var maxCharacterString = "<?php echo _mb("Max characters") ?>: " + meetingPoint_max_characters;
+// document.getElementById("mytext").title = maxCharacterString;
+ document.getElementById("mytext").setAttribute("title",maxCharacterString);
+// document.forms[0].mytext.title = maxCharacterString;
+}
+
+-->
+</script>
+
+<script language='JavaScript'>
+<!--
+<?php
+echo "var used_charset = '".CHARSET ."';";
+?>
+
+function validate(){
+ var mycheck = true;
+ var checkObj= document.forms[0].mytext;
+ if(checkObj.value == '') {
+ alert ("<?php echo _mb("Please define a text!") ?>");
+ checkObj.focus();
+ mycheck=false;
+ return false;
+ }
+
+ var checkObj= document.forms[0].x;
+ if(checkObj.value == '') {
+ alert (meetingPoint_please_click);
+ mycheck = false;
+ }
+
+ if(mycheck == true){
+ if(meetingPoint_export_url != "") {
+ my_meetingPoint = meetingPoint_export_url + "?";
+ }
+ else {
+ my_meetingPoint = document.forms[0].myurl.value + "?";
+ }
+ my_meetingPoint += "name=" + encodeURIComponent(document.forms[0].myuser.value);
+ my_meetingPoint += "&password=" + encodeURIComponent(document.forms[0].mypw.value);
+ my_meetingPoint += "&mb_user_myGui=" + encodeURIComponent(document.forms[0].mygui.value);
+
+ var ind = parent.getMapObjIndexByName('mapframe1');
+ var coord = parent.mb_mapObj[ind].extent.toString().split(",");
+
+ my_meetingPoint += "&mb_myBBOX=" + parseFloat(coord[0]) + ",";
+ my_meetingPoint += parseFloat(coord[1]) + ",";
+ my_meetingPoint += parseFloat(coord[2]) + ",";
+ my_meetingPoint += parseFloat(coord[3]) ;
+
+ my_meetingPoint += "&mb_myPOI=";
+
+ var splitext = document.forms[0].mytext.value;
+ document.forms[0].mytext.value = splitext.substring(0, meetingPoint_max_characters);
+
+ my_meetingPoint += encodeURIComponent(document.forms[0].mytext.value);
+
+ my_meetingPoint += "___" + document.forms[0].x.value + "___";
+ my_meetingPoint += document.forms[0].y.value;
+
+ if(meetingPoint_export_format == 'email') {
+ createEmail(my_meetingPoint,meetingPoint_export_subject);
+ }
+ else {
+ var div = parent.$("<div/>").attr("title", "Treffpunkt").text(meetingPoint_export_subject);
+ var textarea = parent.$("<textarea />").attr({
+ "rows": 5,
+ "cols": 30
+ }).text(my_meetingPoint);
+ div.append("<br /><br />");
+ div.append(textarea);
+ div.dialog();
+ // prompt(meetingPoint_export_subject,my_meetingPoint);
+ }
+ }
+}
+
+function emptyfields(){
+ document.forms[0].mytext.value ='';
+ document.forms[0].x.value ='';
+ document.forms[0].y.value = '';
+ mod_meetingPoint_hide();
+}
+
+function createEmail (url,subject) {
+ var email = "mailto:"
+ email += "";
+ email += "?subject=";
+ email += subject;
+ email += "&body=";
+ email += escape(url);
+
+ var win = window.open(email, 'email', 'top=120,left=120');
+ win.close();
+}
+
+function goBack(where){
+ document.location.href=where;
+}
+
+function init(){
+ parent.mb_regButton_frame("init_mod_meetingPoint","meetingPoint",null);
+}
+
+-->
+</script>
+
+</head>
+<body onload="setMaxCharacterTitle()">
+
+<form action="" >
+
+<input class='strinput' type="hidden" name='myurl' value='<?php echo LOGIN; ?>'>
+
+<input class='strinput' type="hidden" name='mygui' value='<?php echo Mapbender::session()->get("mb_user_gui"); ?>'>
+
+<input class='strinput' type="hidden" name='myuser' value='<?php echo Mapbender::session()->get("mb_user_name"); ?>'>
+
+<input class='strinput' type="hidden" name='mypw' value='<?php echo Mapbender::session()->get("mb_user_password"); ?>'>
+<!--<input class='strinput' type="textarea" size=2 name='mytext' value='' "maxlength=70" title="max. 70 Zeichen">-->
+<textarea class='strinput' rows="3" name='mytext' id='mytext' onmouseover='checkMaxCharacters()' title='' onkeyup='checkMaxCharacters()'></textarea>
+<br><br>
+<img id='my_getCoords' name='my_getCoords' onclick="mod_meetingPoint_run()" onmouseover ="parent.mb_regButton_frame('init_mod_meetingPoint','meetingPoint',null)" title="Treffpunkt setzen" src = '../img/button_digitize/point_off.png'>
+<br><br>
+<input class="okbutton" name="Send" type="button" value="ok" onclick="validate();">
+<input class="ibutton" type="button" value="<?php echo _mb("cancel") ?>" onClick="emptyfields();">
+<br>
+<input class="coord" type="hidden" name='x' value='' readonly>
+<input class="coord" type="hidden" name='y' value='' readonly>
+<br>
+</form>
+</body>
+</html>
Modified: trunk/mapbender/resources/db/install_geoportal_mb28.sh
===================================================================
--- trunk/mapbender/resources/db/install_geoportal_mb28.sh 2019-06-05 16:29:36 UTC (rev 10138)
+++ trunk/mapbender/resources/db/install_geoportal_mb28.sh 2019-06-06 09:30:35 UTC (rev 10139)
@@ -466,10 +466,13 @@
UPDATE gui_category SET category_name='Anwendung' WHERE category_id=2;
UPDATE gui_category SET category_description='Anwendungen (Applications)' WHERE category_id=2;
+--update root user account - secure password
+UPDATE mb_user SET password='$2y$10$b1e6We95mWnp5cFNQYCGke0P4srwdGgiytnSqbyudHB5muzKZ9us.',is_active=true, mb_user_digest_hash='MD5' WHERE mb_user_id=1;
+
--add anonymous user
-INSERT INTO mb_user (mb_user_id, mb_user_name, mb_user_password, mb_user_owner, mb_user_description, mb_user_login_count, mb_user_email, mb_user_phone, mb_user_department, mb_user_resolution, mb_user_organisation_name, mb_user_position_name, mb_user_phone1, mb_user_facsimile, mb_user_delivery_point, mb_user_city, mb_user_postal_code, mb_user_country, mb_user_online_resource, mb_user_textsize, mb_user_glossar, mb_user_last_login_date, mb_user_digest, mb_user_realname, mb_user_street, mb_user_housenumber, mb_user_reference, mb_user_for_attention_of, mb_user_valid_from, mb_user_valid_to, mb_user_password_ticket, mb_user_firstname, mb_user_lastname, mb_user_academictitle, timestamp_create, timestamp, mb_user_spatial_suggest, mb_user_newsletter, mb_user_allow_survey, mb_user_aldigest) VALUES (${mapbender_guest_user_id}, 'guest', '084e0343a0486ff05530df6c705c8bb4', 1, 'test', 0, 'kontakt at geoportal.rlp.de', NULL, '', 72, '', '', NULL, NULL, NULL, '', NULL, NULL, NULL, 'textsize3', 'ja', '2
012-01-26', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2013-07-05 08:09:25.560359', '2015-08-20 10:04:04.952796', 'nein', true, true, NULL);
+INSERT INTO mb_user (mb_user_id, mb_user_name, mb_user_password, mb_user_owner, mb_user_description, mb_user_login_count, mb_user_email, mb_user_phone, mb_user_department, mb_user_resolution, mb_user_organisation_name, mb_user_position_name, mb_user_phone1, mb_user_facsimile, mb_user_delivery_point, mb_user_city, mb_user_postal_code, mb_user_country, mb_user_online_resource, mb_user_textsize, mb_user_glossar, mb_user_last_login_date, mb_user_digest, mb_user_realname, mb_user_street, mb_user_housenumber, mb_user_reference, mb_user_for_attention_of, mb_user_valid_from, mb_user_valid_to, mb_user_password_ticket, mb_user_firstname, mb_user_lastname, mb_user_academictitle, timestamp_create, timestamp, mb_user_spatial_suggest, mb_user_newsletter, mb_user_allow_survey, mb_user_aldigest, password, is_active, mb_user_digest_hash, create_digest) VALUES (${mapbender_guest_user_id}, 'guest', '084e0343a0486ff05530df6c705c8bb4', 1, 'test', 0, 'kontakt at geoportal.rlp.de', NULL, '', 72, '', '', NULL
, NULL, NULL, '', NULL, NULL, NULL, 'textsize3', 'ja', '2012-01-26', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2013-07-05 08:09:25.560359', '2015-08-20 10:04:04.952796', 'nein', true, true, NULL,'$2y$10$TO.aRX0Wed2AboScHd6gl.QFbsAswS23/uAVmcOCFU34Y0uu6ZNA.',true, 'MD5', false);
-INSERT INTO mb_user (mb_user_id, mb_user_name, mb_user_password, mb_user_owner, mb_user_description, mb_user_login_count, mb_user_email, mb_user_phone, mb_user_department, mb_user_resolution, mb_user_organisation_name, mb_user_position_name, mb_user_phone1, mb_user_facsimile, mb_user_delivery_point, mb_user_city, mb_user_postal_code, mb_user_country, mb_user_online_resource, mb_user_textsize, mb_user_glossar, mb_user_last_login_date, mb_user_digest, mb_user_realname, mb_user_street, mb_user_housenumber, mb_user_reference, mb_user_for_attention_of, mb_user_valid_from, mb_user_valid_to, mb_user_password_ticket, mb_user_firstname, mb_user_lastname, mb_user_academictitle, timestamp_create, timestamp, mb_user_spatial_suggest, mb_user_newsletter, mb_user_allow_survey, mb_user_aldigest) VALUES (${mapbender_subadmin_default_user_id}, 'bereichsadmin1', '3ad58afdc417b975256af7a6d3eda7a5', 1, '', 0, 'kontakt at geoportal.rlp.de', NULL, NULL, 72, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NUL
L, NULL, 'nein', '2017-07-28', '3c345c2af80400e1e4c94ed0a967e713', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'bereichsadmin1', 'bereichsadmin1', '', '2013-07-05 08:09:25.560359', '2017-07-28 10:12:13.926954', 'nein', false, false, '2a32c845b23d82bea4653810f146397b');
+INSERT INTO mb_user (mb_user_id, mb_user_name, mb_user_password, mb_user_owner, mb_user_description, mb_user_login_count, mb_user_email, mb_user_phone, mb_user_department, mb_user_resolution, mb_user_organisation_name, mb_user_position_name, mb_user_phone1, mb_user_facsimile, mb_user_delivery_point, mb_user_city, mb_user_postal_code, mb_user_country, mb_user_online_resource, mb_user_textsize, mb_user_glossar, mb_user_last_login_date, mb_user_digest, mb_user_realname, mb_user_street, mb_user_housenumber, mb_user_reference, mb_user_for_attention_of, mb_user_valid_from, mb_user_valid_to, mb_user_password_ticket, mb_user_firstname, mb_user_lastname, mb_user_academictitle, timestamp_create, timestamp, mb_user_spatial_suggest, mb_user_newsletter, mb_user_allow_survey, mb_user_aldigest, password, is_active, mb_user_digest_hash, create_digest) VALUES (${mapbender_subadmin_default_user_id}, 'bereichsadmin1', '3ad58afdc417b975256af7a6d3eda7a5', 1, '', 0, 'kontakt at geoportal.rlp.de', NULL, NULL
, 72, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'nein', '2017-07-28', '3c345c2af80400e1e4c94ed0a967e713', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'bereichsadmin1', 'bereichsadmin1', '', '2013-07-05 08:09:25.560359', '2017-07-28 10:12:13.926954', 'nein', false, false, '2a32c845b23d82bea4653810f146397b','$2y$10$CctxVEa/YCRpwfoJ0ydP9etPR.rHrtAckxICDiKNqjsjU.J2WEXhC',true, 'MD5', false);
INSERT INTO mb_group VALUES (${mapbender_subadmin_group_id}, 'Bereichsadmin', 1, 'Diensteadministratoren der Behörden', '', NULL, '', '', '', '', '', '', '', '', '', NULL, NULL, '2013-07-05 08:09:25.732456', '2018-05-25 08:57:07.988259', NULL, NULL, NULL, NULL, NULL, NULL, true);
Modified: trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql
===================================================================
--- trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql 2019-06-05 16:29:36 UTC (rev 10138)
+++ trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql 2019-06-06 09:30:35 UTC (rev 10139)
@@ -2747,15 +2747,16 @@
ALTER TABLE mb_user ADD COLUMN uuid uuid;
-ALTER TABLE mb_user ADD COLUMN mb_user_digest_hash character varying(100);
+ALTER TABLE mb_user ADD COLUMN mb_user_digest_hash character varying(100) DEFAULT 'MD5';
ALTER TABLE mb_user ALTER COLUMN mb_user_password TYPE varchar(255);
ALTER TABLE mb_user ADD COLUMN create_digest boolean DEFAULT false;
+--set all current users default to be active
+--UPDATE mb_user SET is_active = true;
-
More information about the Mapbender_commits
mailing list