[Geomoose-users] URL parameters

Dan Little danlittle at yahoo.com
Tue Feb 8 11:02:09 EST 2011


If everything is on the fly could you use a work flow like this:

1) "Mystery User Action" -> generate_mapbook.php (or .py, .pl, .rb whatever 
you're using)
 * Generate_mapbook.php would then set a cookie...
   PHP:
     $unique_id = uniqid('mapbook_');
     $temp_dir = "/tmp/dumping_grounds/";

     # do some code to generate the mapbook goes here,
     # with the file written to $temp_dir.$unique_id.'xml'
     # if you wanted good security and use a lookup table you could do some
    # good tricks with PostgreSQL or MySQL here.... but I'll keep this example 
simple, since, well, it's free. :-)
     setcookie('UU_MAPBOOK', $unique_id);

     # do some sort of forwarding or serve up geomoose.html directly from the 
script.


2) Then modify config.php

  function getMapbook() {
        global $CONFIGURATION;
        $mapbook = new DOMDocument();
  
       if($_COOKIE['UU_MAPBOOK']) {
        # it would be good to add some code to strip "." and "/" and "\" from 
the UU_MAPBOOK
        # value so that someone doing malicious things does not try to read 
other files on your hard drive.

        $temp_dir = tmp/dumping_grounds/";
        $mapbook->load($temp_dir.$_COOKIE['UU_MAPBOOK'].'xml');
       } else { 
        # load the default...
        $mapbook->load('../../conf/'.$CONFIGURATION['mapbook']);
       }
        return $mapbook;

  }



>
>From: Carl Burn <burnsy at northcountrywoods.co.uk>
>To: Dan Little <danlittle at yahoo.com>
>Cc: geomoose-users at lists.sourceforge.net
>Sent: Tue, February 8, 2011 9:39:29 AM
>Subject: Re: [Geomoose-users] URL parameters
>
>Hi,
>
>
>mid afternoon here, still a while to go before I head off...and I think that may 
>be extended so I can resolve this one. 
>
>
>I am passing in the parameter for map book every time a user accesses geomoose 
>as they all have unique files...and just to be really fun they are likely to be 
>unique on every visit, so I am generating a mapbook on the fly as the user 
>attempts to access geomoose.
>
>
>Not to sure I understand what you mean by 1 or 2 but I think I may head over and 
>get a copy of 1.x
>
>
>Cheers
>
>
>Carl
>
>
>On Tue, Feb 8, 2011 at 3:24 PM, Dan Little <danlittle at yahoo.com> wrote:
>
>Good morning (at least for me, you're probably trying to leave the office about 
>now)!
>>
>>
>>GM2.2 doesn't directly support passing in a mapbook parameter as did the 1.X 
>>series.  The reason for this is three-fold:
>>1) It wasn't a terribly popular functionality.
>>2) It was a gaping security hole.
>>3) It requires all of the subsequent services to know they need to switch 
>>mapbooks.
>>
>>
>>There are some options, and they all center around modifying the getMapbook 
>>function of config.php.  Two popular solutions:
>>1) Parser the "referrer url" from the HTTP header and get the mapbook parameter 
>>from that.
>>2) Read a cookie for a login/authorization schema and select the appropriate  
>>mapbook.
>>
>>
>>
>>
>>
>>>
>>>From: Carl Burn <burnsy at northcountrywoods.co.uk>
>>>To: geomoose-users at lists.sourceforge.net
>>>Sent: Tue, February 8, 2011 9:18:01 AM
>>>Subject: [Geomoose-users] URL parameters
>>>
>>>Hi All,
>>>
>>>
>>>I am passing across a url parameter of mapbook to geomoose and it looks like it 
>>>is simply being ignored, for example:
>>>
>>>
>>>http://www.aqua3.com:2112/geomoose2/geomoose.html?mapbook=62_1364345175.xml
>>>
>>>
>>>The system simply uses the default mapbook as defined in the config.ini file and 
>>>ignores the url parameter totally, I checked the documentation link for this and 
>>>my call looks correct. The mapbook file is valid and works if I put it into the 
>>>config.ini. I also tried not setting a mapbook in the config.ini..this results 
>>>in no map even when the mapbook is specified on the url as a  parameter. 
>>>I know its going to be an obvious one but can someone point out what I have 
>>>missed please.
>>>
>>>
>>>Best
>>>
>>>
>>>Carl
>>
>


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20110208/ba5a6df5/attachment.html


More information about the Geomoose-users mailing list