From af1763b10fa04ee9b0eb2c3cdfecfa65937731c1 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sun, 12 Mar 2023 09:28:43 +0100 Subject: [PATCH] remove download links, they are implemented in an extension --- inc/inc.ClassAccessOperation.php | 19 --------- op/op.DownloadLink.php | 69 -------------------------------- 2 files changed, 88 deletions(-) delete mode 100644 op/op.DownloadLink.php diff --git a/inc/inc.ClassAccessOperation.php b/inc/inc.ClassAccessOperation.php index 6789952e4..0cb5662ae 100644 --- a/inc/inc.ClassAccessOperation.php +++ b/inc/inc.ClassAccessOperation.php @@ -526,25 +526,6 @@ class SeedDMS_AccessOperation { return false; } /* }}} */ - /** - * Check if download link to document version may be created - * - * Creating a download link to a document content is only allowed if the document was not - * obsoleted. There may be other requirements which are not taken into - * account here. - */ - function mayCreateDownloadLink($document) { /* {{{ */ - if(get_class($document) == $this->dms->getClassname('document')) { - if($latestContent = $document->getLatestContent()) { - $status = $latestContent->getStatus(); - if ($status["status"]!=S_OBSOLETE) { - return true; - } - } - } - return false; - } /* }}} */ - /** * Check for access permission on view * diff --git a/op/op.DownloadLink.php b/op/op.DownloadLink.php deleted file mode 100644 index 064872f4f..000000000 --- a/op/op.DownloadLink.php +++ /dev/null @@ -1,69 +0,0 @@ -getUser(); - $document = $link->getDocument(); - $version = $ling->getVersion(); - - $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); - $controller = Controller::factory($tmp[1]); - $accessop = new SeedDMS_AccessOperation($dms, $user, $settings); - if (!$accessop->check_controller_access($controller, $_POST)) { - UI::exitError(getMLText("document_title", array("documentname" => "")),getMLText("access_denied")); - } - - if (!is_object($document)) { - UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); - - } - - if ($document->getAccessMode($user) < M_READ) { - UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied")); - } - - $content = $document->getContentByVersion($version); - - if (!is_object($content)) { - UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version")); - } - - $controller->setParam('content', $content); - $controller->version(); - -} /* }}} */ - -add_log_line(); -exit();