From: Michael Gapczynski Date: Sat, 18 Feb 2012 02:56:20 +0000 (-0500) Subject: Temporary fix for sharing files X-Git-Tag: v4.0.0beta~201^2~42 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6f1ed85f0b6a7e675951a587f1308211b698a6d5;p=nextcloud-server.git Temporary fix for sharing files --- diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php index 049a74278b3..42739bdfba9 100644 --- a/apps/files_sharing/lib_share.php +++ b/apps/files_sharing/lib_share.php @@ -88,12 +88,15 @@ class OC_Share { $uid = $uid."@".$gid; } $query->execute(array($uid_owner, $uid, $source, $target, $permissions)); - // Clear the folder size cache for the 'Shared' folder -// $clearFolderSize = OC_DB::prepare("DELETE FROM *PREFIX*foldersize WHERE path = ?"); -// $clearFolderSize->execute(array($sharedFolder)); - // Emit post_create and post_write hooks to notify of a new file in the user's filesystem - OC_Hook::emit("OC_Filesystem", "post_create", array('path' => $target)); - OC_Hook::emit("OC_Filesystem", "post_write", array('path' => $target)); + // Add file to filesystem cache + $userDirectory = "/".OC_User::getUser()."/files"; + $data = OC_Filecache::get(substr($source, strlen($userDirectory))); + $parentQuery = OC_DB::prepare('SELECT id FROM *PREFIX*fscache WHERE path=?'); + $parentResult = $parentQuery->execute(array($sharedFolder))->fetchRow(); + $parent = $parentResult['id']; + $is_writeable = $permissions & OC_Share::WRITE; + $cacheQuery = OC_DB::prepare('INSERT INTO *PREFIX*fscache(parent, name, path, size, mtime, ctime, mimetype, mimepart, user, writable) VALUES(?,?,?,?,?,?,?,?,?,?)'); + $cacheQuery->execute(array($parent, basename($target), $target, $data['size'], $data['mtime'], $data['ctime'], $data['mimetype'], dirname($data['mimetype']), $uid, $is_writeable)); } } } diff --git a/lib/filestorage/google.php b/lib/filestorage/google.php new file mode 100644 index 00000000000..fc271f4e4ba --- /dev/null +++ b/lib/filestorage/google.php @@ -0,0 +1,55 @@ +. +*/ + +class OC_Filestorage_Google extends OC_Filestorage_Common { + + private $auth; + + public function __construct($parameters) { + + } + + private function connect() { + + } + public function mkdir($path){} + public function rmdir($path){} + public function opendir($path){} + public function is_dir($path){} + public function is_file($path){} + public function stat($path){} + public function filetype($path){} + public function is_readable($path){} + public function is_writable($path){} + public function file_exists($path){} + public function unlink($path){} + public function rename($path1,$path2){} + public function fopen($path,$mode){} + public function toTmpFile($path){} + public function fromTmpFile($tmpPath,$path){} + public function fromUploadedFile($tmpPath,$path){} + public function getMimeType($path){} + public function hash($type,$path,$raw){} + public function free_space($path){} + public function search($query){} + public function getLocalFile($path){} +} \ No newline at end of file