[Geomoose-users] URL parameters

Carl Burn burnsy at northcountrywoods.co.uk
Wed Feb 9 07:07:32 EST 2011


Hello again,

took a stab at this and I have set up two cookies for the purpose of passing
across my values for the mapbook I want to use and building the file name to
be used from two elements which are separated with an underscore.

I have replaced the getmapbook function with the new code as follows:

function getMapbook() {
        global $CONFIGURATION;
        $mapbook = new DOMDocument();

       if($_COOKIE['UU_MAPBOOK']) {

 $mapbook->load('../../conf/'.$_COOKIE['UU_USERID']'_'.$_COOKIE['UU_MAPBOOK']'.xml');
        # $mapbook->load('../../conf/'.$CONFIGURATION['mapbook']);

       } else {
        # load the default...
        $mapbook->load('../../conf/'.$CONFIGURATION['mapbook']);
       }
        return $mapbook;
  }

This results in an empty application (not showing any layers or toolbar),
first thing I did was to check the cookies
I guess I have something wrong in the way that I build up the file name as
the mapbook is not called, I know that the code is seeing the cookie and
have tested this by simply putting in a test file name instead of the values
from the cookies and then the mapbook is read and the application works.

So the error lies here I think:

$mapbook->load('../../conf/'.$_COOKIE['UU_USERID']'_'.$_COOKIE['UU_MAPBOOK']'.xml');

anybody see my error?

Many thanks

Carl

On Tue, Feb 8, 2011 at 4:08 PM, Dan Little <danlittle at yahoo.com> wrote:

> You are correct, check out my previous post.
>
>
> *From:* Carl Burn <burnsy at northcountrywoods.co.uk>
> *To:* geomoose-users at lists.sourceforge.net
> *Sent:* Tue, February 8, 2011 10:05:19 AM
> *Subject:* Re: [Geomoose-users] URL parameters
>
> Hello again,
>
> I took a look at this and the code I think I need to alter is pretty much
> this section of the config.php file:
>
> # Load the configration file
> $CONFIGURATION = parse_ini_file('../../conf/settings.ini');
>
> function getMapbook() {
> global $CONFIGURATION;
> $mapbook = new DOMDocument();
>  $mapbook->load('../../conf/'.$CONFIGURATION['mapbook']);
> return $mapbook;
> }
>
> I am a CF person not a php person (so bear with me) but this looks like it
> gets the mapbook from the settings.ini, reads it and then puts the content
> into a variable called mapbook. So if I can modify this functionality to
> take the details from the url parameter I am passing in then that should be
> it, the security I can handle in other ways.
>
> Is this making sense?
>
> Carl
>
>
>
> On Tue, Feb 8, 2011 at 3:43 PM, Carl Burn <burnsy at northcountrywoods.co.uk>wrote:
>
>> Hello all,
>>
>> one thought occurs, how do I go about changing the name of the index file
>> that is called when geomoose starts up, at the moment this is geomoose.html.
>> Is this simply a case of changing the file name or is it wired into the
>> setup of geomoose, if I can alter the file extension then I can see a way to
>> solve this easily.
>>
>> Carl
>>
>> On Tue, Feb 8, 2011 at 3:39 PM, Carl Burn <burnsy at northcountrywoods.co.uk
>> > wrote:
>>
>>> 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/20110209/2423dc07/attachment.html


More information about the Geomoose-users mailing list