<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><div>If everything is on the fly could you use a work flow like this:</div><div><br></div><div>1) "Mystery User Action" -> generate_mapbook.php (or .py, .pl, .rb whatever you're using)</div><div> * Generate_mapbook.php would then set a cookie...</div><div> PHP:</div><div> $unique_id = uniqid('mapbook_');</div><div> $temp_dir = "/tmp/dumping_grounds/";</div><div><br></div><div> # do some code to generate the mapbook goes here,</div><div> # with the file written to $temp_dir.$unique_id.'xml'</div><div> # if you wanted good security and use a lookup table you could do some</div><div> # good tricks with PostgreSQL or MySQL here.... but I'll keep this example simple, since, well,
it's free. :-)</div><div> setcookie('UU_MAPBOOK', $unique_id);</div><div><br></div><div> # do some sort of forwarding or serve up geomoose.html directly from the script.</div><div><br></div><div><br></div><div>2) Then modify config.php</div><div><br></div><div> function getMapbook() {</div><div> global $CONFIGURATION;</div><div><div> $mapbook = new DOMDocument();</div><div> </div></div><div> if($_COOKIE['UU_MAPBOOK']) {</div><div> # it would be good to add some code to strip "." and "/" and "\" from the UU_MAPBOOK</div><div> # value so that someone doing malicious things does not try to read other files on your hard drive.</div><div><br></div><div> $temp_dir
= tmp/dumping_grounds/";</div><div> $mapbook->load($temp_dir.$_COOKIE['UU_MAPBOOK'].'xml');</div><div> } else { </div><div> # load the default...</div><div> $mapbook->load('../../conf/'.$CONFIGURATION['mapbook']);</div><div> }</div><div> return $mapbook;</div><div><br></div><div> }</div><div><br></div><div><br></div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><br><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><font size="2" face="Tahoma"><b><span style="font-weight: bold;">From:</span></b> Carl Burn <burnsy@northcountrywoods.co.uk><br><b><span style="font-weight: bold;">To:</span></b>
Dan Little <danlittle@yahoo.com><br><b><span style="font-weight: bold;">Cc:</span></b> geomoose-users@lists.sourceforge.net<br><b><span style="font-weight: bold;">Sent:</span></b> Tue, February 8, 2011 9:39:29 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Geomoose-users] URL parameters<br></font><br>
Hi,<div><br></div><div>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. </div><div><br></div><div>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.</div>
<div><br></div><div>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</div><div><br></div><div>Cheers</div><div><br></div><div>Carl<br><br><div class="gmail_quote">On Tue, Feb 8, 2011 at 3:24 PM, Dan Little <span dir="ltr"><<a rel="nofollow" ymailto="mailto:danlittle@yahoo.com" target="_blank" href="mailto:danlittle@yahoo.com">danlittle@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-family:arial, helvetica, sans-serif;font-size:10pt;"><div>Good morning (at least for me, you're probably trying to leave the office about now)!</div>
<div><br></div><div>GM2.2 doesn't directly support passing in a mapbook parameter as did the 1.X series. The reason for this is three-fold:</div><div>1) It wasn't a terribly popular functionality.</div><div>2) It was a gaping security hole.</div>
<div>3) It requires all of the subsequent services to know they need to switch mapbooks.</div><div><br></div><div>There are some options, and they all center around modifying the getMapbook function of config.php. Two popular solutions:</div>
<div>1) Parser the "referrer url" from the HTTP header and get the mapbook parameter from that.</div><div>2) Read a cookie for a login/authorization schema and select the appropriate
mapbook.</div><div><br></div><div><br></div><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;"><div style="font-family:arial, helvetica, sans-serif;font-size:10pt;"><br><div style="font-family:times new roman, new york, times, serif;font-size:12pt;">
<font size="2" face="Tahoma"><b><span style="font-weight:bold;">From:</span></b> Carl Burn <<a rel="nofollow" ymailto="mailto:burnsy@northcountrywoods.co.uk" target="_blank" href="mailto:burnsy@northcountrywoods.co.uk">burnsy@northcountrywoods.co.uk</a>><br><b><span style="font-weight:bold;">To:</span></b> <a rel="nofollow" ymailto="mailto:geomoose-users@lists.sourceforge.net" target="_blank" href="mailto:geomoose-users@lists.sourceforge.net">geomoose-users@lists.sourceforge.net</a><br>
<b><span style="font-weight:bold;">Sent:</span></b> Tue, February 8, 2011 9:18:01 AM<br><b><span style="font-weight:bold;">Subject:</span></b> [Geomoose-users] URL parameters<br></font><br>
Hi All,<div><br></div><div>I am passing across a url parameter of mapbook to geomoose and it looks like it is simply being ignored, for example:</div><div><br></div><div><span><span><a target="_blank" href="http://www.aqua3.com:2112/geomoose2/geomoose.html?mapbook=62_1364345175.xml">http://www.aqua3.com:2112/geomoose2/geomoose.html?mapbook=62_1364345175.xml</a></span></span></div>
<div><br></div><div>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. </div>
<div>I know its going to be an obvious one but can someone point out what I have missed please.</div><div><br></div><div>Best</div><div><br></div><div>Carl</div>
</div></div></blockquote><div></div>
</div><br>
</div></blockquote></div><br></div>
</div></div></blockquote><div style="position:fixed"></div>
</div><br>
</body></html>