BUG 7344 Feature -> PDF Security settings

With this settings is possible to setup security for a PDF generated (Output Document).
In Output Document setup there is a new section available when the output document is either PDF or BOTH with the following fields:
Permissions: Must select wich permissions will be granted (if none is selected only VIEW is allowed)
Open Password: Is the password requested to open the document. (This open the document with selected permissions)
Owner Password: Is the password that allow owner to open and change permissions
This commit is contained in:
Hugo Loza
2011-07-29 17:46:22 -04:00
parent b47d9fa01e
commit daf7ac09b1
16 changed files with 844 additions and 258 deletions

View File

@@ -618,6 +618,20 @@ class OutputDocument extends BaseOutputDocument {
$g_media->set_landscape($GLOBALS['g_config']['landscape']);
$g_media->set_margins($GLOBALS['g_config']['margins']);
$g_media->set_pixels($GLOBALS['g_config']['pagewidth']);
if(isset($GLOBALS['g_config']['pdfSecurity'])){
if (isset($GLOBALS['g_config']['pdfSecurity']['openPassword']) && $GLOBALS['g_config']['pdfSecurity']['openPassword'] != "") {
$GLOBALS['g_config']['pdfSecurity']['openPassword'] = G::decrypt($GLOBALS['g_config']['pdfSecurity']['openPassword'], $sUID);
}
if (isset($GLOBALS['g_config']['pdfSecurity']['ownerPassword']) && $GLOBALS['g_config']['pdfSecurity']['ownerPassword'] != "") {
$GLOBALS['g_config']['pdfSecurity']['ownerPassword'] = G::decrypt($GLOBALS['g_config']['pdfSecurity']['ownerPassword'], $sUID);
}
$g_media->set_security($GLOBALS['g_config']['pdfSecurity']);
require_once(HTML2PS_DIR . 'pdf.fpdf.encryption.php');
}
$pipeline = new Pipeline();
if (extension_loaded('curl'))
{