summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/sharedstorage.php
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-02-28 10:39:23 -0500
committerMichael Gapczynski <mtgap@owncloud.com>2013-02-28 10:39:23 -0500
commitb5989c933f3c51887724d89e989a3e2af4207d6e (patch)
tree40677bfa8daa1357b1ca3a561b551a142cbe6c82 /apps/files_sharing/lib/sharedstorage.php
parentea83acedebbcf70b19643efe82b72fb139cf8ad2 (diff)
parent93e713d3781c5d5fc6d0dbb6c6a0a8f9c2e15b97 (diff)
downloadnextcloud-server-b5989c933f3c51887724d89e989a3e2af4207d6e.tar.gz
nextcloud-server-b5989c933f3c51887724d89e989a3e2af4207d6e.zip
Merge branch 'master' into shared-folder-etags
Conflicts: apps/files_sharing/lib/sharedstorage.php
Diffstat (limited to 'apps/files_sharing/lib/sharedstorage.php')
-rw-r--r--apps/files_sharing/lib/sharedstorage.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 0163f2e00b4..19abc838258 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -250,7 +250,8 @@ class Shared extends \OC\Files\Storage\Common {
public function file_put_contents($path, $data) {
if ($source = $this->getSourcePath($path)) {
// Check if permission is granted
- if (($this->file_exists($path) && !$this->isUpdatable($path)) || ($this->is_dir($path) && !$this->isCreatable($path))) {
+ if (($this->file_exists($path) && !$this->isUpdatable($path))
+ || ($this->is_dir($path) && !$this->isCreatable($path))) {
return false;
}
$info = array(
@@ -333,7 +334,8 @@ class Shared extends \OC\Files\Storage\Common {
if ($this->isCreatable(dirname($path2))) {
$source = $this->fopen($path1, 'r');
$target = $this->fopen($path2, 'w');
- return \OC_Helper::streamCopy($source, $target);
+ list ($count, $result) = \OC_Helper::streamCopy($source, $target);
+ return $result;
}
return false;
}
@@ -409,9 +411,12 @@ class Shared extends \OC\Files\Storage\Common {
}
public static function setup($options) {
- if (!\OCP\User::isLoggedIn() || \OCP\User::getUser() != $options['user'] || \OCP\Share::getItemsSharedWith('file')) {
+ if (!\OCP\User::isLoggedIn() || \OCP\User::getUser() != $options['user']
+ || \OCP\Share::getItemsSharedWith('file')) {
$user_dir = $options['user_dir'];
- \OC\Files\Filesystem::mount('\OC\Files\Storage\Shared', array('sharedFolder' => '/Shared'), $user_dir.'/Shared/');
+ \OC\Files\Filesystem::mount('\OC\Files\Storage\Shared',
+ array('sharedFolder' => '/Shared'),
+ $user_dir.'/Shared/');
\OC_Hook::connect('OC_Filesystem', 'post_write', '\OC\Files\Cache\Shared_Updater', 'writeHook');
\OC_Hook::connect('OC_Filesystem', 'post_delete', '\OC\Files\Cache\Shared_Updater', 'deleteHook');
\OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Shared_Updater', 'renameHook');