[Mapbender-commits] r7632 - in trunk/mapbender/http: javascripts php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Feb 21 11:23:43 EST 2011


Author: armin11
Date: 2011-02-21 08:23:43 -0800 (Mon, 21 Feb 2011)
New Revision: 7632

Modified:
   trunk/mapbender/http/javascripts/mod_savewmc.js
   trunk/mapbender/http/php/mod_savewmc_server.php
Log:
Bugfix for storing wmc docs in tmp folder; deactivate browser check for saving wmc - do this after map request for all browsers

Modified: trunk/mapbender/http/javascripts/mod_savewmc.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_savewmc.js	2011-02-20 19:17:58 UTC (rev 7631)
+++ trunk/mapbender/http/javascripts/mod_savewmc.js	2011-02-21 16:23:43 UTC (rev 7632)
@@ -74,7 +74,7 @@
 var browserCompatibilityMode = typeof options.browserCompatibilityMode === "undefined" ?
 	0 : options.browserCompatibilityMode;
 
-var userAgent = navigator.userAgent;
+/*var userAgent = navigator.userAgent;
 
 var pattern1=/Chrome/gi;
 var pattern2=/Konqueror/gi;
@@ -85,6 +85,9 @@
 	//alert("Identified Browser don't support beforeunload sufficiently - the application will be slower than normal!");
 	browserCompatibilityMode = 1;
 }
+//for all save by afterMapRequest
+browserCompatibilityMode = 0;
+*/
 
 function pausecomp(millis) { //http://www.sean.co.uk/a/webdesign/javascriptdelay.shtm
 	var date = new Date();

Modified: trunk/mapbender/http/php/mod_savewmc_server.php
===================================================================
--- trunk/mapbender/http/php/mod_savewmc_server.php	2011-02-20 19:17:58 UTC (rev 7631)
+++ trunk/mapbender/http/php/mod_savewmc_server.php	2011-02-21 16:23:43 UTC (rev 7632)
@@ -61,24 +61,25 @@
 }
 
 if ($saveInSession === 1) {
-    // CLEAN SESSION WMC FILES
-    $tmp = scandir(TMPDIR);
+    // CLEAN SESSION WMC FILES 
+    //do this by cronjob!
+    //$tmp = scandir(TMPDIR);
     // get all files from tmp folder
-    for($p = 0; $p < count($tmp); $p++) {
+    /*for($p = 0; $p < count($tmp); $p++) {
         // match timestamp on begin of the filename
         if(preg_match("/^([\d]+).*$/i", $tmp[$p],$timestamp)) {
             // if file older than 24h, remove it.
             if((time() - $timestamp[1]) >= 86400) { // 86400 = 24h
-                unlink(TMPDIR."/".$tmp[$p]);
+                unlink(TMPDIR."/wmc/".$tmp[$p]);
             }
         }
-    }
+    }*/
     
 	// store XML in tmp folder
     if(Mapbender::session()->get("mb_wmc")) {
         $filename = Mapbender::session()->get("mb_wmc");
     } else {
-        $filename = TMPDIR."/".time()."_".uniqid();//will be set to new one cause ?
+        $filename = TMPDIR."/wmc/".time()."_".uniqid();//will be set to new one cause ?
     }
     file_put_contents($filename, $wmc->xml);
 	Mapbender::session()->set("mb_wmc",$filename);



More information about the Mapbender_commits mailing list