summaryrefslogtreecommitdiffstats
path: root/apps/files_publiclink
diff options
context:
space:
mode:
authorJakob Sack <kde@jakobsack.de>2011-07-29 21:36:03 +0200
committerJakob Sack <kde@jakobsack.de>2011-07-29 21:36:03 +0200
commitbafd684eb694ed0bd86b46ff7cd36382c1cebc34 (patch)
treec3bb1e013d563263002d052eb41032076a36a5f9 /apps/files_publiclink
parent220132ca237f5077f5145bf327e8528a652ad559 (diff)
downloadnextcloud-server-bafd684eb694ed0bd86b46ff7cd36382c1cebc34.tar.gz
nextcloud-server-bafd684eb694ed0bd86b46ff7cd36382c1cebc34.zip
Renaming classes :-)
Diffstat (limited to 'apps/files_publiclink')
-rw-r--r--apps/files_publiclink/admin.php16
-rw-r--r--apps/files_publiclink/appinfo/app.php2
-rw-r--r--apps/files_publiclink/get.php24
-rw-r--r--apps/files_publiclink/lib_public.php10
4 files changed, 26 insertions, 26 deletions
diff --git a/apps/files_publiclink/admin.php b/apps/files_publiclink/admin.php
index 9a1a9ce03c2..8187039c3a6 100644
--- a/apps/files_publiclink/admin.php
+++ b/apps/files_publiclink/admin.php
@@ -28,25 +28,25 @@ require_once( 'lib_public.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();
}
-OC_APP::setActiveNavigationEntry( "files_publiclink_administration" );
+OC_App::setActiveNavigationEntry( "files_publiclink_administration" );
-OC_UTIL::addStyle( 'files_publiclink', 'admin' );
-OC_UTIL::addScript( 'files_publiclink', 'admin' );
+OC_Util::addStyle( 'files_publiclink', 'admin' );
+OC_Util::addScript( 'files_publiclink', 'admin' );
if(isset($_SERVER['HTTPS'])) {
- $baseUrl= "https://". $_SERVER['SERVER_NAME'] . OC_HELPER::linkTo('files_publiclink','get.php');
+ $baseUrl= "https://". $_SERVER['SERVER_NAME'] . OC_Helper::linkTo('files_publiclink','get.php');
}else{
- $baseUrl= "http://". $_SERVER['SERVER_NAME'] . OC_HELPER::linkTo('files_publiclink','get.php');
+ $baseUrl= "http://". $_SERVER['SERVER_NAME'] . OC_Helper::linkTo('files_publiclink','get.php');
}
// return template
-$tmpl = new OC_TEMPLATE( "files_publiclink", "admin", "admin" );
+$tmpl = new OC_Template( "files_publiclink", "admin", "admin" );
$tmpl->assign( 'links', OC_PublicLink::getLinks());
$tmpl->assign('baseUrl',$baseUrl);
$tmpl->printPage();
diff --git a/apps/files_publiclink/appinfo/app.php b/apps/files_publiclink/appinfo/app.php
index 894327e83d3..314a3bf896a 100644
--- a/apps/files_publiclink/appinfo/app.php
+++ b/apps/files_publiclink/appinfo/app.php
@@ -1,6 +1,6 @@
<?php
-OC_APP::addSettingsPage( array( "id" => "files_publiclink_administration", "order" => 1, "href" => OC_HELPER::linkTo( "files_publiclink", "admin.php" ), "name" => "Public Links", "icon" => OC_HELPER::imagePath( "files_publiclink", "share.png" )));
+OC_App::addSettingsPage( array( "id" => "files_publiclink_administration", "order" => 1, "href" => OC_Helper::linkTo( "files_publiclink", "admin.php" ), "name" => "Public Links", "icon" => OC_Helper::imagePath( "files_publiclink", "share.png" )));
?>
diff --git a/apps/files_publiclink/get.php b/apps/files_publiclink/get.php
index 3bc961bc37d..6bcefc2e4e8 100644
--- a/apps/files_publiclink/get.php
+++ b/apps/files_publiclink/get.php
@@ -18,18 +18,18 @@ if($path!==false){
$subPath='';
}
$path.=$subPath;
- if(!OC_FILESYSTEM::file_exists($path)){
+ if(!OC_Filesystem::file_exists($path)){
header("HTTP/1.0 404 Not Found");
- $tmpl = new OC_TEMPLATE( '', '404', 'guest' );
+ $tmpl = new OC_Template( '', '404', 'guest' );
$tmpl->assign('file',$subPath);
$tmpl->printPage();
exit;
}
- if(OC_FILESYSTEM::is_dir($path)){
+ if(OC_Filesystem::is_dir($path)){
$files = array();
$rootLength=strlen($root);
- foreach( OC_FILES::getdirectorycontent( $path ) as $i ){
- $i['date'] = OC_UTIL::formatDate($i['mtime'] );
+ foreach( OC_Files::getdirectorycontent( $path ) as $i ){
+ $i['date'] = OC_Util::formatDate($i['mtime'] );
$i['directory']=substr($i['directory'],$rootLength);
if($i['directory']=='/'){
$i['directory']='';
@@ -47,36 +47,36 @@ if($path!==false){
}
}
- $breadcrumbNav = new OC_TEMPLATE( "files_publiclink", "breadcrumb", "" );
+ $breadcrumbNav = new OC_Template( "files_publiclink", "breadcrumb", "" );
$breadcrumbNav->assign( "breadcrumb", $breadcrumb );
$breadcrumbNav->assign('token',$token);
- $list = new OC_TEMPLATE( 'files_publiclink', 'files', '' );
+ $list = new OC_Template( 'files_publiclink', 'files', '' );
$list->assign( 'files', $files );
$list->assign('token',$token);
- $tmpl = new OC_TEMPLATE( 'files_publiclink', 'index', 'user' );
+ $tmpl = new OC_Template( 'files_publiclink', 'index', 'user' );
$tmpl->assign('fileList', $list->fetchPage());
$tmpl->assign( "breadcrumb", $breadcrumbNav->fetchPage() );
$tmpl->printPage();
}else{
//get time mimetype and set the headers
- $mimetype=OC_FILESYSTEM::getMimeType($path);
+ $mimetype=OC_Filesystem::getMimeType($path);
header('Content-Transfer-Encoding: binary');
header('Content-Disposition: attachment; filename="'.basename($path).'"');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Type: ' . $mimetype);
- header('Content-Length: ' . OC_FILESYSTEM::filesize($path));
+ header('Content-Length: ' . OC_Filesystem::filesize($path));
//download the file
@ob_clean();
- OC_FILESYSTEM::readfile($path);
+ OC_Filesystem::readfile($path);
}
}else{
header("HTTP/1.0 404 Not Found");
- $tmpl = new OC_TEMPLATE( '', '404', 'guest' );
+ $tmpl = new OC_Template( '', '404', 'guest' );
$tmpl->printPage();
die();
}
diff --git a/apps/files_publiclink/lib_public.php b/apps/files_publiclink/lib_public.php
index b4bc86505ae..ff1df130834 100644
--- a/apps/files_publiclink/lib_public.php
+++ b/apps/files_publiclink/lib_public.php
@@ -6,8 +6,8 @@ class OC_PublicLink{
* @param int (optional) expiretime time the link expires, as timestamp
*/
public function __construct($path,$expiretime=0){
- if($path and OC_FILESYSTEM::file_exists($path) and OC_FILESYSTEM::is_readable($path)){
- $user=OC_USER::getUser();
+ if($path and OC_Filesystem::file_exists($path) and OC_Filesystem::is_readable($path)){
+ $user=OC_User::getUser();
$token=sha1("$user-$path-$expiretime");
$query=OC_DB::prepare("INSERT INTO *PREFIX*publiclink VALUES(?,?,?,?)");
$result=$query->execute(array($token,$path,$user,$expiretime));
@@ -38,7 +38,7 @@ class OC_PublicLink{
$user=$data[0]['user'];
//prepare the filesystem
- OC_UTIL::setupFS($user);
+ OC_Util::setupFS($user);
return $path;
}else{
@@ -60,7 +60,7 @@ class OC_PublicLink{
*/
static public function getLinks(){
$query=OC_DB::prepare("SELECT * FROM *PREFIX*publiclink WHERE user=?");
- return $query->execute(array(OC_USER::getUser()))->fetchAll();
+ return $query->execute(array(OC_User::getUser()))->fetchAll();
}
/**
@@ -69,7 +69,7 @@ class OC_PublicLink{
static public function delete($token){
$query=OC_DB::prepare("SELECT user,path FROM *PREFIX*publiclink WHERE token=?");
$result=$query->execute(array($token))->fetchAll();
- if(count($result)>0 and $result[0]['user']==OC_USER::getUser()){
+ if(count($result)>0 and $result[0]['user']==OC_User::getUser()){
$query=OC_DB::prepare("DELETE FROM *PREFIX*publiclink WHERE token=?");
$query->execute(array($token));
}