HOR-2820
This commit is contained in:
@@ -50,9 +50,21 @@ $sAppDocUid = $oAppDocument->getAppDocUid();
|
||||
$sDocUid = $oAppDocument->Fields['DOC_UID'];
|
||||
|
||||
$oOutputDocument = new OutputDocument();
|
||||
$oOutputDocument->Fields = $oOutputDocument->getByUid( $sDocUid );
|
||||
$oOutputDocument->Fields = $oOutputDocument->getByUid($sDocUid);
|
||||
$download = $oOutputDocument->Fields['OUT_DOC_OPEN_TYPE'];
|
||||
|
||||
//Check if the user can be download the Output Document
|
||||
if (!$oAppDocument->canDownloadOutput(
|
||||
$oAppDocument->Fields['USR_UID'],
|
||||
$_SESSION['USER_LOGGED'],
|
||||
$oOutputDocument->Fields['PRO_UID'],
|
||||
$oAppDocument->Fields['APP_UID'],
|
||||
$sAppDocUid)
|
||||
) {
|
||||
G::header('Location: /errors/error403.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$info = pathinfo( $oAppDocument->getAppDocFilename() );
|
||||
if (! isset( $_GET['ext'] )) {
|
||||
$ext = $info['extension'];
|
||||
@@ -83,7 +95,7 @@ if (file_exists( $realPath )) {
|
||||
$realPath = $realPath2;
|
||||
}
|
||||
|
||||
if (! $sw_file_exists) {
|
||||
if (!$sw_file_exists) {
|
||||
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT )) {
|
||||
@@ -137,10 +149,6 @@ if (! $sw_file_exists) {
|
||||
if (!$downloadStatus) {
|
||||
G::streamFile( $realPath, $download, $nameFile); //download
|
||||
}
|
||||
|
||||
//die($realPath);
|
||||
//G::streamFile( $realPath, $download, $info['basename'] . $ver . '.' . $ext );
|
||||
}
|
||||
}
|
||||
//G::streamFile ( $realPath, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user