diff options
author | Robin Appelman <icewind1991@gmail.com> | 2012-01-08 01:53:40 +0100 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2012-01-08 01:53:40 +0100 |
commit | d1edc360d9bd7d97c35d25b54dadec61004cd869 (patch) | |
tree | 7344744268280ccbdc194746a7b40dfc90a33260 /apps/files_sharing | |
parent | 3844fb0e4ce093bb3c2e67d20f85f61b7723efdc (diff) | |
parent | 8f8985c3e53862e2ca6446f296d4835a9577faac (diff) | |
download | nextcloud-server-d1edc360d9bd7d97c35d25b54dadec61004cd869.tar.gz nextcloud-server-d1edc360d9bd7d97c35d25b54dadec61004cd869.zip |
merge master into filesystem
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/ajax/getitem.php | 1 | ||||
-rw-r--r-- | apps/files_sharing/sharedstorage.php | 24 |
2 files changed, 12 insertions, 13 deletions
diff --git a/apps/files_sharing/ajax/getitem.php b/apps/files_sharing/ajax/getitem.php index d9df4abe984..51fda6aed40 100644 --- a/apps/files_sharing/ajax/getitem.php +++ b/apps/files_sharing/ajax/getitem.php @@ -19,6 +19,7 @@ $source = dirname($source); while ($source != "" && $source != "/" && $source != "." && $source != $userDirectory) { if ($values = OC_Share::getMySharedItem($source)) { $values = array_values($values); + $users = array(); $parentUsers = array(); for ($i = 0; $i < count($values); $i++) { if ($values[$i]['uid_shared_with'] == OC_Share::PUBLICLINK) { diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php index f7849d499f0..529a82b830a 100644 --- a/apps/files_sharing/sharedstorage.php +++ b/apps/files_sharing/sharedstorage.php @@ -79,20 +79,16 @@ class OC_Filestorage_Shared extends OC_Filestorage { if ($path == "" || $path == "/") { $path = $this->datadir.$path; $sharedItems = OC_Share::getItemsInFolder($path); - if (empty($sharedItems)) { - return false; - } else { - global $FAKEDIRS; - $files = array(); - foreach ($sharedItems as $item) { - // If item is in the root of the shared storage provider and the item exists add it to the fakedirs - if (dirname($item['target'])."/" == $path && $this->file_exists(basename($item['target']))) { - $files[] = basename($item['target']); - } + global $FAKEDIRS; + $files = array(); + foreach ($sharedItems as $item) { + // If item is in the root of the shared storage provider and the item exists add it to the fakedirs + if (dirname($item['target'])."/" == $path && $this->file_exists(basename($item['target']))) { + $files[] = basename($item['target']); } - $FAKEDIRS['shared'] = $files; - return opendir('fakedir://shared'); } + $FAKEDIRS['shared'] = $files; + return opendir('fakedir://shared'); } else { $source = $this->getSource($path); if ($source) { @@ -264,7 +260,9 @@ class OC_Filestorage_Shared extends OC_Filestorage { } public function is_writeable($path) { - if ($path == "" || $path == "/" || OC_Share::getPermissions($this->datadir.$path) & OC_Share::WRITE) { + if($path == "" || $path == "/"){ + return false; + }elseif (OC_Share::getPermissions($this->datadir.$path) & OC_Share::WRITE) { return true; } else { return false; |