summaryrefslogtreecommitdiffstats
path: root/files/download.php
diff options
context:
space:
mode:
Diffstat (limited to 'files/download.php')
-rw-r--r--files/download.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/files/download.php b/files/download.php
index f7fbcd0f857..cc52b930f72 100644
--- a/files/download.php
+++ b/files/download.php
@@ -23,33 +23,32 @@
// Init owncloud
require_once('../lib/base.php');
-require( 'template.php' );
// Check if we are a user
-if( !OC_USER::isLoggedIn()){
- header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn()){
+ header( "Location: ".OC_Helper::linkTo( "index.php" ));
exit();
}
$filename = $_GET["file"];
-if(!OC_FILESYSTEM::file_exists($filename)){
+if(!OC_Filesystem::file_exists($filename)){
header("HTTP/1.0 404 Not Found");
- $tmpl = new OC_TEMPLATE( '', '404', 'guest' );
+ $tmpl = new OC_Template( '', '404', 'guest' );
$tmpl->assign('file',$filename);
$tmpl->printPage();
exit;
}
-$ftype=OC_FILESYSTEM::getMimeType( $filename );
+$ftype=OC_Filesystem::getMimeType( $filename );
header('Content-Type:'.$ftype);
header('Content-Disposition: attachment; filename="'.basename($filename).'"');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
-header('Content-Length: '.OC_FILESYSTEM::filesize($filename));
+header('Content-Length: '.OC_Filesystem::filesize($filename));
ob_end_clean();
-OC_FILESYSTEM::readfile( $filename );
+OC_Filesystem::readfile( $filename );
?>