mkdir() now checks isWriteable() to see if it has permission, rmdir unshares the folder from the user

This commit is contained in:
Michael Gapczynski 2011-07-07 19:22:23 -04:00
parent 58e8312b1c
commit b7c45ba240
1 changed files with 13 additions and 11 deletions

View File

@ -53,22 +53,24 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} }
} }
// TODO OC_SHARE::getPermissions()
public function mkdir($path) { public function mkdir($path) {
$source = $this->getSource($path); if ($path == "" || $path == "/") {
if ($source) { return false;
$storage = OC_FILESYSTEM::getStorage($source); } else {
return $storage->mkdir($this->getInternalPath($source)); $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) { public function rmdir($path) {
$source = $this->getSource($path); // The folder will be removed from the database, but won't be deleted from the owner's filesystem
if ($source) { $target = OC_FILESYSTEM::getStorageMountPoint($this).$path;
$storage = OC_FILESYSTEM::getStorage($source); OC_SHARE::unshareFromSelf($target);
return $storage->rmdir($this->getInternalPath($source));
}
} }
// TODO Change files within shared folders that are renamed // TODO Change files within shared folders that are renamed