summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/sharedstorage.php
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2011-07-07 19:22:23 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2011-07-07 19:22:23 -0400
commitb7c45ba240f4a51fa9fae786c4c4f7d05920a839 (patch)
tree6fdfda46d743c7cc8168c21912c324461a05debe /apps/files_sharing/sharedstorage.php
parent58e8312b1c9dbfd5af39ccf737463d9a3dd3f801 (diff)
downloadnextcloud-server-b7c45ba240f4a51fa9fae786c4c4f7d05920a839.tar.gz
nextcloud-server-b7c45ba240f4a51fa9fae786c4c4f7d05920a839.zip
mkdir() now checks isWriteable() to see if it has permission, rmdir unshares the folder from the user
Diffstat (limited to 'apps/files_sharing/sharedstorage.php')
-rw-r--r--apps/files_sharing/sharedstorage.php24
1 files changed, 13 insertions, 11 deletions
diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php
index a3f6bebb0f7..5f343331cde 100644
--- a/apps/files_sharing/sharedstorage.php
+++ b/apps/files_sharing/sharedstorage.php
@@ -53,22 +53,24 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
}
}
- // TODO OC_SHARE::getPermissions()
public function mkdir($path) {
- $source = $this->getSource($path);
- if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
- return $storage->mkdir($this->getInternalPath($source));
+ if ($path == "" || $path == "/") {
+ return false;
+ } else {
+ $source = $this->getSource($path);
+ if ($source) {
+ if (OC_SHARE::isWriteable($path)) {
+ $storage = OC_FILESYSTEM::getStorage($source);
+ return $storage->mkdir($this->getInternalPath($source));
+ }
+ }
}
}
- // TODO OC_SHARE::getPermissions()
public function rmdir($path) {
- $source = $this->getSource($path);
- if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
- return $storage->rmdir($this->getInternalPath($source));
- }
+ // The folder will be removed from the database, but won't be deleted from the owner's filesystem
+ $target = OC_FILESYSTEM::getStorageMountPoint($this).$path;
+ OC_SHARE::unshareFromSelf($target);
}
// TODO Change files within shared folders that are renamed