getMLText("invalid_request_token"))),getMLText("invalid_request_token")); } if (!isset($_POST["documentid"]) || !is_numeric($_POST["documentid"]) || intval($_POST["documentid"])<1) { UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); } $documentid = $_POST["documentid"]; $document = $dms->getDocument($documentid); 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")); } if (!isset($_POST["version"]) || !is_numeric($_POST["version"]) || intval($_POST["version"])<1) { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version")); } $version_num = $_POST["version"]; $version = $document->getContentByVersion($version_num); if (!is_object($version)) { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version")); } if (isset($_POST["expdate"])) $expiration = $_POST["expdate"]; else $expiration = null; if($version->createDownloadLink($user, $expiration)) { $session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_create_download_link'))); } else { $session->setSplashMsg(array('type'=>'error', 'msg'=>getMLText('splash_error_create_download+link'))); } add_log_line("?documentid=".$documentid."&version".$version_num); header("Location:../out/out.ViewDocument.php?documentid=".$documentid); ?>