[Mapbender-commits] r9149 - trunk/mapbender/http/print/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Feb 5 02:18:19 PST 2015
Author: armin11
Date: 2015-02-05 02:18:18 -0800 (Thu, 05 Feb 2015)
New Revision: 9149
Modified:
trunk/mapbender/http/print/classes/mbPdf.php
Log:
Give option to define that https should be used by the module which gives back the rendered pdf even if the server where mapbender is installed don't handle certificates. This maybe useful if https is handeled by a reverse proxy in front of the mapbender installation.
Modified: trunk/mapbender/http/print/classes/mbPdf.php
===================================================================
--- trunk/mapbender/http/print/classes/mbPdf.php 2015-01-22 09:17:06 UTC (rev 9148)
+++ trunk/mapbender/http/print/classes/mbPdf.php 2015-02-05 10:18:18 UTC (rev 9149)
@@ -32,13 +32,17 @@
die("PDF output not rendered yet.");
}
- public function returnAbsoluteUrl() {
+ public function returnAbsoluteUrl($secureProtocol=false) {
$mbjson = new Mapbender_JSON();
if ($this->isSaved) {
if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on")
$prot = "https://";
else
$prot = "http://";
+ //allow overwrite of protocol for some architectural reasons
+ if ($secureProtocol) {
+ $prot = "https://";
+ }
$absoluteUrlToPdf = $prot.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])."/printPDF_download.php?f=".$this->outputFileName."&".SID;
return $mbjson->encode(array("outputFileName"=>$absoluteUrlToPdf));
}
More information about the Mapbender_commits
mailing list