[Mapbender-commits] r9336 - trunk/mapbender/http/print

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Dec 11 03:13:45 PST 2015


Author: armin11
Date: 2015-12-11 03:13:45 -0800 (Fri, 11 Dec 2015)
New Revision: 9336

Modified:
   trunk/mapbender/http/print/printFactory.php
Log:
Fix for giving away printed pdf via https

Modified: trunk/mapbender/http/print/printFactory.php
===================================================================
--- trunk/mapbender/http/print/printFactory.php	2015-12-10 09:03:01 UTC (rev 9335)
+++ trunk/mapbender/http/print/printFactory.php	2015-12-11 11:13:45 UTC (rev 9336)
@@ -1,11 +1,24 @@
 <?php
-
 require_once dirname(__FILE__) . "/../php/mb_validateSession.php";
 require_once dirname(__FILE__) . "/classes/factoryClasses.php";
-require_once dirname(__FILE__) . "/../include/dyn_php.php";
+$gui_id = Mapbender::session()->get("mb_user_gui");
+//select all element_ids from database, if $_REQUEST['e_id'] is in this list - use this e_id for getting php_var
+$sql = "SELECT e_id FROM gui_element WHERE fkey_gui_id = $1";
+$v = array($gui_id);
+$t = array("s");
+$res = db_prep_query($sql, $v, $t);
+$e_id = false;
+while ($row = db_fetch_array($res)){
+	if ($row['e_id'] == $_REQUEST['e_id']) {
+		$e_id = $row['e_id'];
+		break;	
+	}
+}
 
+if ($e_id != false) {
+	include dirname(__FILE__) . "/../include/dyn_php.php";
+}
 $pf = new mbPdfFactory();
-
 $confFile = basename($_REQUEST["printPDF_template"]);
 if (!preg_match("/^[a-zA-Z0-9_-]+(\.[a-zA-Z0-9]+)$/", $confFile) || 
 	!file_exists($_REQUEST["printPDF_template"])) {



More information about the Mapbender_commits mailing list