From 7096292dcd80ee99e913a7b4e6e33429806010d4 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 8 Mar 2010 18:18:31 +0000 Subject: [PATCH] use session object for PDF from edit page --- lam/lib/lists.inc | 31 +++++++++++++++++++++++++------ lam/lib/modules.inc | 2 +- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index edc77b3f..f72f7bfe 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -519,6 +519,11 @@ class lamList { exit; } } + elseif ($option == 'SESSION') { + createModulePDF(array($_SESSION[$_POST['PDFSessionID']]),$pdfStruct); + unset($_SESSION[$_GET['PDFSessionID']]); + exit; + } } // check if back from configuration page if (sizeof($this->configOptions) > 0) { @@ -542,6 +547,12 @@ class lamList { * @param String $id account ID */ private function showPDFPage($id) { + $sessionObject = null; + $PDFSessionID = null; + if (($id == null) && isset($_GET['PDFSessionID'])) { + $PDFSessionID = $_GET['PDFSessionID']; + $sessionObject = $_SESSION[$PDFSessionID]; + } // search for checkboxes $selAccounts = array_keys($_POST, "on"); if (!in_array($id, $selAccounts)) { @@ -573,11 +584,19 @@ class lamList { echo _('Create for') . " "; echo ''; echo ''; - echo ''; + // check if account object is already in session + if ($sessionObject != null) { + echo $sessionObject->finalDN; + echo "\n"; + echo "\n"; + } + else { + echo ''; + } echo ''; echo ''; echo ''; @@ -705,7 +724,7 @@ class lamList { protected function listGetParams() { // check if only PDF should be shown if (isset($_GET['printPDF'])) { - $this->showPDFPage($_GET['dn']); + $this->showPDFPage(null); exit(); } // get current page diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index 9ace754a..130f914c 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -1098,7 +1098,7 @@ class accountContainer { } // create PDF file if (isset($_POST['accountContainerCreatePDF'])) { - metaRefresh('../lists/list.php?printPDF=1&type=' . $this->type . "&dn=" . base64_encode($this->finalDN)); + metaRefresh('../lists/list.php?printPDF=1&type=' . $this->type . "&PDFSessionID=" . $this->base); exit; } // module actions