getAccessMode($user) < M_READ)
{
printHTMLHead( getMLText("download") );
printCenterStart();
printStartBox(getMLText("download"));
print "
";
printMLText("operation_not_allowed");
printGoBack();
print "
";
printEndBox();
printCenterEnd();
printHTMLFoot();
exit;
}
$content = $document->getContentByVersion($version);
if (is_bool($content) && !$content)
die("Version " . $version . " of Document \"" . $document->getName() . "\" not found");
if (in_array($content->getFileType(), $settings->_viewOnlineFileTypes))
header("Content-Type: " . $content->getMimeType());
header("Content-Length: " . filesize($settings->_contentDir . $content->getDir() . $content->getFileName()));
header("Expires: 0");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
readfile($settings->_contentDir . $content->getDir() . $content->getFileName());
exit;
?>