Opened 11 years ago

Closed 11 years ago

#885 closed defect (fixed)

Conflicts between owsproxy and mb js cache

Reported by: obgr Owned by: dev
Priority: critical Milestone:
Component: core Version: 2.7.3
Keywords: Cc:

Description

When using the mb js cache, there is a conflict with owsproxy services. The problem is, the service address is stored in the cache files like

* add_wms('1408','1.1.1','Bundesrepublik Deutschland - BW','brd with shapes','http://80.72.141.177/owsproxy/r41eianskrkug5alam75c61gg6/a991293e8c4ff2b24c8f2471624a7e84?','http://80.72.141.177/owsproxy/r41eianskrkug5alam75c61gg6/a991293e8c4ff2b24c8f2471624a7e84?','','','image/png','text/html','application/vnd.ogc.se_xml','EPSG:31467','1','100','');wms_add_data_type_format('map','application/x-pdf'); *

So, when the session the ows proxy uses is expired, the services don't work anymore.

Is there a way to solve that?

Change History (3)

comment:1 by astrid_emde, 11 years ago

Thanks for the report of this misbehaviour. I noticed this before and think we need a solution soon.

A suggestion is that Mapbender replaces the old seession with the new session and checks the permissions for the requested layer.

comment:2 by obgr, 11 years ago

As far as I see, the only place, where the js cache file is read is in http/javascript/initWmcObj.php

So wouldn't a patch like the following work?

diff --git a/http/javascripts/initWmcObj.php b/http/javascripts/initWmcObj.php index 84bbfcb..ce727e6 100644 --- a/http/javascripts/initWmcObj.php +++ b/http/javascripts/initWmcObj.php @@ -78,6 +78,7 @@ else {

$fileName = md5($app); $applicationLoadFile = "../../cache/".$fileName.".app.cache.js";

+

if there is no GET param from outside and the cache file for gui loading exists, load outputstring from file if($activateCache && !Mapbender::session()->get("mb_wmc") &&

!getConfiguration("WMC") &&

@@ -88,6 +89,7 @@ if($activateCache && !Mapbender::session()->get("mb_wmc") &&

file_exists($applicationLoadFile) ) {

$outputString = file_get_contents($applicationLoadFile);

+ $outputString = preg_replace('|/owsproxy/.*/|U', '/owsproxy/'.session_id().'/', $outputString);

} else {

$wmcDocSession = false;

Of course it is crude, but...

comment:3 by verenadiewald, 11 years ago

Resolution: fixed
Status: newclosed

tested your solution, it works :-)

see: http://trac.osgeo.org/mapbender/changeset/8529

Note: See TracTickets for help on using tickets.