aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2013-02-22 22:59:09 +0100
committerThomas Mueller <thomas.mueller@tmit.eu>2013-02-22 22:59:09 +0100
commit9898ba4daf1acdead2ed5fa6024e779caafb353e (patch)
tree3fc02fea4997344c73e0bc5ac7bdfc5616d7a7df /apps/files_sharing/lib
parent5062ae250b767867609f64c29ab4cde65f022b75 (diff)
parent78fce834058a38a7dbcc5310e16095c743434bc6 (diff)
downloadnextcloud-server-9898ba4daf1acdead2ed5fa6024e779caafb353e.tar.gz
nextcloud-server-9898ba4daf1acdead2ed5fa6024e779caafb353e.zip
Merge branch 'master' into master-sqlserver
Conflicts: core/templates/installation.php
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/cache.php5
-rw-r--r--apps/files_sharing/lib/permissions.php3
-rw-r--r--apps/files_sharing/lib/share/file.php14
-rw-r--r--apps/files_sharing/lib/share/folder.php5
-rw-r--r--apps/files_sharing/lib/sharedstorage.php10
5 files changed, 27 insertions, 10 deletions
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index 9655e447875..fb0f6c7b5a6 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -71,8 +71,9 @@ class Shared_Cache extends Cache {
}
} else {
$query = \OC_DB::prepare(
- 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted`
- FROM `*PREFIX*filecache` WHERE `fileid` = ?');
+ 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`,'
+ .' `size`, `mtime`, `encrypted`'
+ .' FROM `*PREFIX*filecache` WHERE `fileid` = ?');
$result = $query->execute(array($file));
$data = $result->fetchRow();
$data['fileid'] = (int)$data['fileid'];
diff --git a/apps/files_sharing/lib/permissions.php b/apps/files_sharing/lib/permissions.php
index 2b068ff9350..72c1ec96c46 100644
--- a/apps/files_sharing/lib/permissions.php
+++ b/apps/files_sharing/lib/permissions.php
@@ -33,7 +33,8 @@ class Shared_Permissions extends Permissions {
if ($fileId == -1) {
return \OCP\PERMISSION_READ;
}
- $source = \OCP\Share::getItemSharedWithBySource('file', $fileId, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE, null, true);
+ $source = \OCP\Share::getItemSharedWithBySource('file', $fileId, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE,
+ null, true);
if ($source) {
return $source['permissions'];
} else {
diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php
index 6d3c55a008f..0aeb763d89a 100644
--- a/apps/files_sharing/lib/share/file.php
+++ b/apps/files_sharing/lib/share/file.php
@@ -72,7 +72,11 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
public function formatItems($items, $format, $parameters = null) {
if ($format == self::FORMAT_SHARED_STORAGE) {
// Only 1 item should come through for this format call
- return array('path' => $items[key($items)]['path'], 'permissions' => $items[key($items)]['permissions'], 'uid_owner' => $items[key($items)]['uid_owner']);
+ return array(
+ 'path' => $items[key($items)]['path'],
+ 'permissions' => $items[key($items)]['permissions'],
+ 'uid_owner' => $items[key($items)]['uid_owner']
+ );
} else if ($format == self::FORMAT_GET_FOLDER_CONTENTS) {
$files = array();
foreach ($items as $item) {
@@ -99,7 +103,13 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
}
$size += (int)$item['size'];
}
- return array('fileid' => -1, 'name' => 'Shared', 'mtime' => $mtime, 'mimetype' => 'httpd/unix-directory', 'size' => $size);
+ return array(
+ 'fileid' => -1,
+ 'name' => 'Shared',
+ 'mtime' => $mtime,
+ 'mimetype' => 'httpd/unix-directory',
+ 'size' => $size
+ );
} else if ($format == self::FORMAT_OPENDIR) {
$files = array();
foreach ($items as $item) {
diff --git a/apps/files_sharing/lib/share/folder.php b/apps/files_sharing/lib/share/folder.php
index 11c8c6b1e80..4426beec636 100644
--- a/apps/files_sharing/lib/share/folder.php
+++ b/apps/files_sharing/lib/share/folder.php
@@ -33,7 +33,8 @@ class OC_Share_Backend_Folder extends OC_Share_Backend_File implements OCP\Share
}
while (!empty($parents)) {
$parents = "'".implode("','", $parents)."'";
- $query = OC_DB::prepare('SELECT `fileid`, `name`, `mimetype` FROM `*PREFIX*filecache` WHERE `parent` IN ('.$parents.')');
+ $query = OC_DB::prepare('SELECT `fileid`, `name`, `mimetype` FROM `*PREFIX*filecache`'
+ .' WHERE `parent` IN ('.$parents.')');
$result = $query->execute();
$parents = array();
while ($file = $result->fetchRow()) {
@@ -47,4 +48,4 @@ class OC_Share_Backend_Folder extends OC_Share_Backend_File implements OCP\Share
return $children;
}
-} \ No newline at end of file
+}
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 65812b7e2fd..c7521949da1 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -240,7 +240,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(
@@ -390,9 +391,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/');
}
}