[Mapbender-commits] r8526 - in trunk/mapbender: conf http/php tools
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Dec 11 07:15:30 PST 2012
Author: armin11
Date: 2012-12-11 07:15:29 -0800 (Tue, 11 Dec 2012)
New Revision: 8526
Modified:
trunk/mapbender/conf/mapbender.conf-dist
trunk/mapbender/http/php/mb_getWmsData.php
trunk/mapbender/tools/mod_mailAbo.php
Log:
Some further changes for notification of subscribers and gui owners
Modified: trunk/mapbender/conf/mapbender.conf-dist
===================================================================
--- trunk/mapbender/conf/mapbender.conf-dist 2012-12-11 15:10:00 UTC (rev 8525)
+++ trunk/mapbender/conf/mapbender.conf-dist 2012-12-11 15:15:29 UTC (rev 8526)
@@ -147,7 +147,16 @@
// If "false", LANGUAGE is set to english
define("LANGUAGE", "en"); // only available if USE_I18N is "true".
// "en", "de", "bg", "gr", "nl", "hu", "it", "es","fr","pt"
+# --------------------------------------------
+# Notify subscribers and gui owners by email
+# Mapbender 2.7.4+
+# If set to true, all owners of guis where an updated service is used are notified about the update process.
+# If a layername changed, this information will be part of the mail too!! It enables an external user to actualize the
+# service configuration of his gis client (e.g. reload capabilities).
+# --------------------------------------------
+define("NOTIFY_ON_UPDATE",true);
+
# --------------------------------------------
# RSS
# Mapbender > 2.7 generates a GeoRSS file which shows the changes in the mapbender service database. The
Modified: trunk/mapbender/http/php/mb_getWmsData.php
===================================================================
--- trunk/mapbender/http/php/mb_getWmsData.php 2012-12-11 15:10:00 UTC (rev 8525)
+++ trunk/mapbender/http/php/mb_getWmsData.php 2012-12-11 15:15:29 UTC (rev 8526)
@@ -94,20 +94,8 @@
$mywms->updateObjInDB($myWMS,false, $changedLayerArray);
$mywms->displayWMS();
- $subscribers_ids = $admin->getSubscribersByWms($myWMS);
- $layerChangeInformation = "";
- for ($i=0; $i<count($subscribers_ids); $i++) {
- $e = new mb_notice("Subscriber for wms ".$myWMS." - ".$subscribers_ids[$i]);
- for ($j=0; $j<count($changedLayerArray); $j++) {
- if ($changedLayerArray[$j]["oldLayerName"] != $changedLayerArray[$j]["newLayerName"]) {
- $e = new mb_notice("Old layer name: ".$changedLayerArray[$j]["oldLayerName"]." - changed to: ".$changedLayerArray[$j]["newLayerName"]);
- $layerChangeInformation = _mb("Old layer name: ").$changedLayerArray[$j]["oldLayerName"]._mb(" - changed to: ").$changedLayerArray[$j]["newLayerName"]."\n";
-
- }
- }
- }
// start (owners and subscribers of the updated wms will be notified by email)
- if ($use_php_mailing) {
+ if (defined("NOTIFY_ON_UPDATE") && NOTIFY_ON_UPDATE == true) {
//collect change information
$layerChangeInformation = "";
for ($j=0; $j<count($changedLayerArray); $j++) {
@@ -142,7 +130,8 @@
$replyto = $admin->getEmailByUserId(Mapbender::session()->get("mb_user_id"));
$from = $replyto;
$rootLayerId = getRootLayerId($myWMS);
- if (defined(MAPBENDER_PATH) && MAPBENDER_PATH != '') {
+ //$e = new mb_exception(MAPBENDER_PATH);
+ if (defined("MAPBENDER_PATH") && MAPBENDER_PATH != '') {
$metadataUrl = MAPBENDER_PATH."/php/mod_showMetadata.php?resource=layer&id=".$rootLayerId;
} else {
$metadataUrl = preg_replace(
@@ -153,9 +142,9 @@
}
$path = $pathArray[0];
//Build mailbody
- $body = _mb("WMS")." '" . $admin->getWmsTitleByWmsId($myWMS) . "' "._mb("has been updated.")."\n\n".$metadataUrl. "\n\n"._mb("You may want to check the changes as you are an owner or subscriber of this WMS. If you have integrated the into a gis client, you have to reconfigure the client!");
+ $body = _mb("WMS")." '" . $admin->getWmsTitleByWmsId($myWMS) . "' "._mb("has been updated").".\n\n".$metadataUrl. "\n\n"._mb("You may want to check the changes as you are an owner or subscriber of this WMS. If you have integrated the service into a gis client, you have to reconfigure the client!")."\n"._mb("Note: This e-mail has been sent automatically because you subscribed " . "to this service. You can unsubscribe by logging in and clicking the " . "unsubscribe button in the Mapbender metadata dialogue by following the given link.");
if (isset($layerChangeInformation) && $layerChangeInformation != "") {
- $body .= "\n\n"._mb("Following layers have been renamed:\n").$layerChangeInformation;
+ $body .= "\n\n"._mb("Attention - following layers have been renamed".":\n").$layerChangeInformation;
}
$error_msg = "";
Modified: trunk/mapbender/tools/mod_mailAbo.php
===================================================================
--- trunk/mapbender/tools/mod_mailAbo.php 2012-12-11 15:10:00 UTC (rev 8525)
+++ trunk/mapbender/tools/mod_mailAbo.php 2012-12-11 15:15:29 UTC (rev 8526)
@@ -108,7 +108,7 @@
$res_wms_t = db_prep_query($sql, $v_wms_t, $t_wms_t);
$row_wms_t = db_fetch_array($res_wms_t);
if ($wms_monitor_status == '-1') {
- if (defined(MAPBENDER_PATH) && MAPBENDER_PATH != '') {
+ if (defined("MAPBENDER_PATH") && MAPBENDER_PATH != '') {
$metadataUrl = MAPBENDER_PATH."/php/mod_showMetadata.php?resource=layer&id=";
} else {
$metadataUrl = preg_replace(
@@ -119,7 +119,7 @@
}
//following need to be adopted in another installation than geoportal.rlp!! TODO
//here work some mod_rewrite rule ;-)
- $metadataUrl = "http://www.geoportal.rlp.de/layer/";
+ //$metadataUrl = "http://www.geoportal.rlp.de/layer/";
echo "WMS: ".$wmsid."\n";
$body .= _mb($wms_unreachable_text, $row_wms_t["wms_title"], $wmsid) .
" (" . $wms_monitor_timestamp_end . ")\n" .
More information about the Mapbender_commits
mailing list