check for access on Download and ViewOnline

This commit is contained in:
Uwe Steinmann 2016-08-11 13:25:27 +02:00
parent 8916c83a8e
commit 20f5bd6489

View File

@ -42,6 +42,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
$folder = $this->params['folder']; $folder = $this->params['folder'];
$document = $this->params['document']; $document = $this->params['document'];
$version = $this->params['version']; $version = $this->params['version'];
$accessop = $this->params['accessobject'];
$viewonlinefiletypes = $this->params['viewonlinefiletypes']; $viewonlinefiletypes = $this->params['viewonlinefiletypes'];
$enableversionmodification = $this->params['enableversionmodification']; $enableversionmodification = $this->params['enableversionmodification'];
$cachedir = $this->params['cachedir']; $cachedir = $this->params['cachedir'];
@ -188,9 +189,11 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
//if (($document->getAccessMode($user) >= M_READWRITE)) { //if (($document->getAccessMode($user) >= M_READWRITE)) {
print "<ul class=\"actions unstyled\">"; print "<ul class=\"actions unstyled\">";
if ($file_exists){ if ($file_exists){
print "<li><a href=\"../op/op.Download.php?documentid=".$document->getID()."&version=".$version->getVersion()."\" title=\"".htmlspecialchars($version->getMimeType())."\"><i class=\"icon-download\"></i> ".getMLText("download")."</a>"; if($accessop->check_controller_access('Download', array('action'=>'run')))
print "<li><a href=\"../op/op.Download.php?documentid=".$document->getID()."&version=".$version->getVersion()."\" title=\"".htmlspecialchars($version->getMimeType())."\"><i class=\"icon-download\"></i> ".getMLText("download")."</a>";
if ($viewonlinefiletypes && in_array(strtolower($version->getFileType()), $viewonlinefiletypes)) if ($viewonlinefiletypes && in_array(strtolower($version->getFileType()), $viewonlinefiletypes))
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"icon-star\"></i> " . getMLText("view_online") . "</a>"; if($accessop->check_controller_access('ViewOnline', array('action'=>'run')))
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"icon-star\"></i> " . getMLText("view_online") . "</a>";
print "</ul>"; print "</ul>";
print "<ul class=\"actions unstyled\">"; print "<ul class=\"actions unstyled\">";
} }
@ -362,6 +365,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
} }
?> ?>
</div> </div>
</div>
<?php <?php
$this->contentEnd(); $this->contentEnd();
$this->htmlEndPage(); $this->htmlEndPage();