summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-09-05 10:08:13 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-09-05 10:08:13 +0200
commit7e0f855cafe46dc8bdfc984fcd50e1fd7d69846d (patch)
tree5842ee8a50a8b11cf15b352936d07e61d434c94d /lib/public
parent0e97712ad35d7d2a3ea5828fce0f043b0714888f (diff)
downloadnextcloud-server-7e0f855cafe46dc8bdfc984fcd50e1fd7d69846d.tar.gz
nextcloud-server-7e0f855cafe46dc8bdfc984fcd50e1fd7d69846d.zip
if the files doesn't exist yet we start with the parent to search for shares
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/share.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index cae0e3bdc04..2eca0d3b5d1 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -135,19 +135,25 @@ class Share {
* not '/admin/data/file.txt'
*/
public static function getUsersSharingFile($path, $user, $includeOwner = false) {
-
+ error_log("getuser sharing files for: " . $path . " and " . $user);
$shares = array();
$publicShare = false;
$source = -1;
$cache = false;
- $view = new \OC\Files\View('/' . $user . '/files/');
- $meta = $view->getFileInfo(\OC\Files\Filesystem::normalizePath($path));
+ $view = new \OC\Files\View('/' . $user . '/files');
+ if ($view->file_exists($path)) {
+ $meta = $view->getFileInfo($path);
+ } else {
+ // if the file doesn't exists yet we start with the parent folder
+ $meta = $view->getFileInfo(dirname($path));
+ }
if($meta !== false) {
+ error_log("source: " . $meta['fileid']);
$source = $meta['fileid'];
$cache = new \OC\Files\Cache\Cache($meta['storage']);
- }
+ } else error_log("no source");
while ($source !== -1) {
@@ -166,6 +172,7 @@ class Share {
\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage($result), \OC_Log::ERROR);
} else {
while ($row = $result->fetchRow()) {
+ error_log("add user: " . $row['share_with']);
$shares[] = $row['share_with'];
}
}
@@ -185,6 +192,7 @@ class Share {
\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage($result), \OC_Log::ERROR);
} else {
while ($row = $result->fetchRow()) {
+ error_log("group found: " . $row['share_with']);
$usersInGroup = \OC_Group::usersInGroup($row['share_with']);
$shares = array_merge($shares, $usersInGroup);
}