diff options
author | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-08-05 11:18:35 -0400 |
---|---|---|
committer | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-08-05 11:18:35 -0400 |
commit | 843f8aca7ce89e1aa3d7379a5f06c4e7f340c2c8 (patch) | |
tree | 3a98393f29ca676d9c8ab9ae60f3b52c2c146699 /apps/files_publiclink | |
parent | 8f01abf054d577f923437871a3d6f873317c9544 (diff) | |
download | nextcloud-server-843f8aca7ce89e1aa3d7379a5f06c4e7f340c2c8.tar.gz nextcloud-server-843f8aca7ce89e1aa3d7379a5f06c4e7f340c2c8.zip |
Full support for making and deleting public links from share dropdown
Diffstat (limited to 'apps/files_publiclink')
-rw-r--r-- | apps/files_publiclink/ajax/getlink.php | 8 | ||||
-rw-r--r-- | apps/files_publiclink/lib_public.php | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/apps/files_publiclink/ajax/getlink.php b/apps/files_publiclink/ajax/getlink.php new file mode 100644 index 00000000000..551bcc8780c --- /dev/null +++ b/apps/files_publiclink/ajax/getlink.php @@ -0,0 +1,8 @@ +<?php +$RUNTIME_NOAPPS = true; + +require_once('../../../lib/base.php'); +require_once('../lib_public.php'); + +$path = $_GET['path']; +echo json_encode(OC_PublicLink::getLink($path));
\ No newline at end of file diff --git a/apps/files_publiclink/lib_public.php b/apps/files_publiclink/lib_public.php index ff1df130834..21286fe4ff2 100644 --- a/apps/files_publiclink/lib_public.php +++ b/apps/files_publiclink/lib_public.php @@ -53,7 +53,13 @@ class OC_PublicLink{ 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(); + return $result[0]['token']; + } + /** * gets all public links * @return array |