Commit 8b437984 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Download.php, Html2Pdf.php, Link.php, SendMail.php: Add TOKEN_PAGE as a valid...

Download.php, Html2Pdf.php, Link.php, SendMail.php: Add TOKEN_PAGE as a valid source for download. This should be the same as TOKEN_URL_PARAM.
parent 905428db
......@@ -1086,7 +1086,8 @@ const SENDMAIL_TOKEN_CONCAT = 'C';
const SENDMAIL_TOKEN_DOWNLOAD_FILENAME = 'd';
const SENDMAIL_TOKEN_DOWNLOAD_MODE = 'M';
const SENDMAIL_TOKEN_ATTACHMENT_URL = 'u';
const SENDMAIL_TOKEN_ATTACHMENT_URL_LOCAL = 'U';
const SENDMAIL_TOKEN_ATTACHMENT_URL_PARAM = 'U';
const SENDMAIL_TOKEN_ATTACHMENT_PAGE = 'p';
// Report, BodyText
const TOKEN_SQL = 'sql';
......
......@@ -203,6 +203,7 @@ class Download {
switch ($token) {
case TOKEN_URL:
case TOKEN_URL_PARAM:
case TOKEN_PAGE:
$filename = $this->html2pdf->page2pdf($token, $value);
break;
......
......@@ -177,6 +177,7 @@ class Html2Pdf {
$urlParamString = empty($arr[1]) ? '' : $arr[1];
break;
case TOKEN_URL_PARAM:
case TOKEN_PAGE:
$host = $this->config[SYSTEM_BASE_URL_PRINT];
$urlParamString = $url;
break;
......@@ -213,7 +214,7 @@ class Html2Pdf {
$customHeader = '--custom-header User-Agent ' . escapeshellarg($_SERVER['HTTP_USER_AGENT']) . ' --custom-header-propagation'; // By default 'Typo3' expects the same User-Agent for the FE-Session
// Very important: The current lock on session SESSION_NAME has to be freed, cause wkhtmltopdf will use the same
// session in a few moments and this script remains active all the time.
// session in a few moments and this script remains active during that the time and that would cause a deadlock else.
$this->session->close();
$cmd = "$wkhtmlToPdf $customHeader $cookieOptions $options $urlPrint $filenameEscape";
......
......@@ -473,7 +473,7 @@ class Link {
$value = $this->checkValue($key, $value);
// Store value
if (isset($tokenGiven[TOKEN_DOWNLOAD]) && ($key == TOKEN_URL || $key == TOKEN_URL_PARAM || $key == TOKEN_FILE || $key == TOKEN_FILE_DEPRECATED)) {
if (isset($tokenGiven[TOKEN_DOWNLOAD]) && ($key == TOKEN_PAGE || $key == TOKEN_URL || $key == TOKEN_URL_PARAM || $key == TOKEN_FILE || $key == TOKEN_FILE_DEPRECATED)) {
$vars[NAME_DOWNLOAD_ELEMENTS][] = $key . ':' . $value;
......
......@@ -75,7 +75,7 @@ class SendMail {
/**
* Use the programm 'sendEmail' - http://caspian.dotconf.net/menu/Software/SendEmail
* Body and Subject is UTF8 encoded,
* Body and Subject is UTF8 encoded. Append attachments with '-a <file>'.
*
* @param array $mailConfig
* @return string
......@@ -222,6 +222,7 @@ class SendMail {
* @param array $attachments Array of attachments. Per attachment, different & multiple sources are possible.
* [ [ 0 -> 'F:/etc/hostname' ],
* [ 0 -> 'u:http://nzz.ch', 1 -> 'd:nzz.pdf' ],
* [ 0 -> 'p:id=detailPerson&form=Person&r=1&_sip=1', 1 -> 'F:/etc/hostname' ]
* [ 0 -> 'd:all.pdf', 1 -> 'U:?id=detailPerson&form=Person&r=1&_sip=1', 2 -> 'F:/etc/hostname' ] ]
* @return array Array of filenames. Those files has to be deleted later, if they are temporary files.
* @throws UserReportException
......@@ -261,7 +262,8 @@ class SendMail {
break;
case SENDMAIL_TOKEN_ATTACHMENT_URL:
case SENDMAIL_TOKEN_ATTACHMENT_URL_LOCAL:
case SENDMAIL_TOKEN_ATTACHMENT_URL_PARAM:
case SENDMAIL_TOKEN_ATTACHMENT_PAGE:
if ($downloadMode == '') { // Set only if not explicit given.
$downloadMode = DOWNLOAD_MODE_PDF;
}
......@@ -357,7 +359,8 @@ class SendMail {
case SENDMAIL_TOKEN_ATTACHMENT_FILE:
case SENDMAIL_TOKEN_ATTACHMENT_URL:
case SENDMAIL_TOKEN_ATTACHMENT_URL_LOCAL:
case SENDMAIL_TOKEN_ATTACHMENT_URL_PARAM:
case SENDMAIL_TOKEN_ATTACHMENT_PAGE:
if ($flagSource && !$flagConcat) {
$args[SENDMAIL_TOKEN_ATTACHMENT][] = $attachment;
$attachment = array();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment