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) {
$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