From: Jan-Christoph Borchardt Date: Sat, 24 Sep 2011 21:03:28 +0000 (+0200) Subject: removed 'share by publiclink' app as it has been superseded by Sharing X-Git-Tag: v3.0~154 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a54ea3246cb2d20e3527211d3413f5d3a8dd529f;p=nextcloud-server.git removed 'share by publiclink' app as it has been superseded by Sharing --- diff --git a/apps/files_publiclink/admin.php b/apps/files_publiclink/admin.php deleted file mode 100644 index 03d7a2ff6c5..00000000000 --- a/apps/files_publiclink/admin.php +++ /dev/null @@ -1,46 +0,0 @@ -. -* -*/ - - -// Init owncloud -require_once('../../lib/base.php'); -require_once( 'lib_public.php' ); - - -// Check if we are a user -OC_Util::checkLoggedIn(); - -OC_App::setActiveNavigationEntry( "files_publiclink_administration" ); - -OC_Util::addScript( 'files_publiclink', 'admin' ); - -$baseUrl = OC_Helper::linkTo('files_publiclink','get.php', null, true); - - -// return template -$tmpl = new OC_Template( "files_publiclink", "admin", "user" ); -$tmpl->assign( 'links', OC_PublicLink::getLinks()); -$tmpl->assign('baseUrl',$baseUrl); -$tmpl->printPage(); - -?> diff --git a/apps/files_publiclink/ajax/deletelink.php b/apps/files_publiclink/ajax/deletelink.php deleted file mode 100644 index e2e4ff944a6..00000000000 --- a/apps/files_publiclink/ajax/deletelink.php +++ /dev/null @@ -1,11 +0,0 @@ - \ No newline at end of file diff --git a/apps/files_publiclink/ajax/getlink.php b/apps/files_publiclink/ajax/getlink.php deleted file mode 100644 index 551bcc8780c..00000000000 --- a/apps/files_publiclink/ajax/getlink.php +++ /dev/null @@ -1,8 +0,0 @@ -getToken(); -?> diff --git a/apps/files_publiclink/appinfo/app.php b/apps/files_publiclink/appinfo/app.php deleted file mode 100644 index 5866e2d1c5e..00000000000 --- a/apps/files_publiclink/appinfo/app.php +++ /dev/null @@ -1,6 +0,0 @@ - "files_publiclink_administration", "order" => 2, "href" => OC_Helper::linkTo( "files_publiclink", "admin.php" ), "name" => "Public Links")); - - -?> diff --git a/apps/files_publiclink/appinfo/database.xml b/apps/files_publiclink/appinfo/database.xml deleted file mode 100644 index 4fe6be47d8d..00000000000 --- a/apps/files_publiclink/appinfo/database.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - *dbname* - true - false - latin1 - - *dbprefix*publiclink - - - token - text - - true - 40 - - - path - text - - true - 128 - - - user - text - - - true - 64 - - - expire_time - timestamp - true - - - a_files_publiclink_token - true - - token - ascending - - - -
-
diff --git a/apps/files_publiclink/appinfo/info.xml b/apps/files_publiclink/appinfo/info.xml deleted file mode 100644 index 1d41ea96662..00000000000 --- a/apps/files_publiclink/appinfo/info.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - files_publiclink - Share by Publiclink - Simple file sharing by creating a public link to a file - 0.2 - AGPL - Robin Appelman - 2 - \ No newline at end of file diff --git a/apps/files_publiclink/get.php b/apps/files_publiclink/get.php deleted file mode 100644 index 2e1ba4bf363..00000000000 --- a/apps/files_publiclink/get.php +++ /dev/null @@ -1,83 +0,0 @@ -assign('file',$subPath); - $tmpl->printPage(); - exit; - } - 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'] ); - $i['directory']=substr($i['directory'],$rootLength); - if($i['directory']=='/'){ - $i['directory']=''; - } - $files[] = $i; - } - - // Make breadcrumb - $breadcrumb = array(); - $pathtohere = "/"; - foreach( explode( "/", $subPath ) as $i ){ - if( $i != "" ){ - $pathtohere .= "$i/"; - $breadcrumb[] = array( "dir" => $pathtohere, "name" => $i ); - } - } - - $breadcrumbNav = new OC_Template( "files_publiclink", "breadcrumb", "" ); - $breadcrumbNav->assign( "breadcrumb", $breadcrumb ); - $breadcrumbNav->assign('token',$token); - - $list = new OC_Template( 'files_publiclink', 'files', '' ); - $list->assign( 'files', $files ); - $list->assign('token',$token); - - $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); - header('Content-Transfer-Encoding: binary'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - header('Content-Disposition: filename="'.basename($path).'"'); - header('Content-Type: ' . $mimetype); - header('Content-Length: ' . OC_Filesystem::filesize($path)); - - //download the file - @ob_clean(); - OC_Filesystem::readfile($path); - } -}else{ - header("HTTP/1.0 404 Not Found"); - $tmpl = new OC_Template( '', '404', 'guest' ); - $tmpl->printPage(); - die(); -} -?> \ No newline at end of file diff --git a/apps/files_publiclink/js/admin.js b/apps/files_publiclink/js/admin.js deleted file mode 100644 index 91ee58beda8..00000000000 --- a/apps/files_publiclink/js/admin.js +++ /dev/null @@ -1,45 +0,0 @@ -$(document).ready(function() { - $( "#path" ).autocomplete({ - source: "../../files/ajax/autocomplete.php", - minLength: 1 - }); - $(".delete").live('click', function( event ) { - event.preventDefault(); - var token=$(this).attr('data-token'); - var data="token="+token; - $.ajax({ - type: 'GET', - url: 'ajax/deletelink.php', - cache: false, - data: data, - success: function(){ - $('#'+token).remove(); - } - }); - }); - $('#newlink').submit(function( event ){ - event.preventDefault(); - var path=$('#path').val(); - var expire=0; - var data='path='+path+'&expire='+expire; - $.ajax({ - type: 'GET', - url: 'ajax/makelink.php', - cache: false, - data: data, - success: function(token){ - if(token){ - var html=""; - html+=""+path+""; - html+="" - html+="" - html+="" - $(html).insertAfter($('#newlink_row')); - $('#path').val(''); - $('#'+token+' input').focus(); - $('#'+token+' input').select(); - } - } - }); - }); -}); diff --git a/apps/files_publiclink/lib_public.php b/apps/files_publiclink/lib_public.php deleted file mode 100644 index f895615380d..00000000000 --- a/apps/files_publiclink/lib_public.php +++ /dev/null @@ -1,84 +0,0 @@ -execute(array($token,$path,$user,$expiretime)); - if( PEAR::isError($result)) { - $entry = 'DB Error: "'.$result->getMessage().'"
'; - $entry .= 'Offending command was: '.$result->getDebugInfo().'
'; - if(defined("DEBUG") && DEBUG) {error_log( $entry );} - die( $entry ); - } - $this->token=$token; - } - } - - /** - * get the path of that shared file - */ - public static function getPath($token) { - //get the path and the user - $query=OC_DB::prepare("SELECT user,path FROM *PREFIX*publiclink WHERE token=?"); - $result=$query->execute(array($token)); - $data=$result->fetchAll(); - if(count($data)>0){ - $path=$data[0]['path']; - $user=$data[0]['user']; - - //prepare the filesystem - OC_Util::setupFS($user); - - return $path; - }else{ - return false; - } - } - - /** - * get the token for the public link - * @return string - */ - public function getToken(){ - return $this->token; - } - - public static function getLink($path) { - $query=OC_DB::prepare("SELECT token FROM *PREFIX*publiclink WHERE user=? AND path=? LIMIT 1"); - $result=$query->execute(array(OC_User::getUser(),$path))->fetchAll(); - if(count($result)>0){ - return $result[0]['token']; - } - } - - /** - * gets all public links - * @return array - */ - static public function getLinks(){ - $query=OC_DB::prepare("SELECT * FROM *PREFIX*publiclink WHERE user=?"); - return $query->execute(array(OC_User::getUser()))->fetchAll(); - } - - /** - * delete a public link - */ - 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()){ - $query=OC_DB::prepare("DELETE FROM *PREFIX*publiclink WHERE token=?"); - $query->execute(array($token)); - } - } - - private $token; -} -?> diff --git a/apps/files_publiclink/templates/admin.php b/apps/files_publiclink/templates/admin.php deleted file mode 100644 index b5c04b838bd..00000000000 --- a/apps/files_publiclink/templates/admin.php +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - -