mkdir() now checks isWriteable() to see if it has permission, rmdir unshares the folder from the user
This commit is contained in:
parent
58e8312b1c
commit
b7c45ba240
|
@ -53,24 +53,26 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO OC_SHARE::getPermissions()
|
|
||||||
public function mkdir($path) {
|
public function mkdir($path) {
|
||||||
|
if ($path == "" || $path == "/") {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
$source = $this->getSource($path);
|
$source = $this->getSource($path);
|
||||||
if ($source) {
|
if ($source) {
|
||||||
|
if (OC_SHARE::isWriteable($path)) {
|
||||||
$storage = OC_FILESYSTEM::getStorage($source);
|
$storage = OC_FILESYSTEM::getStorage($source);
|
||||||
return $storage->mkdir($this->getInternalPath($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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function rmdir($path) {
|
||||||
|
// 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
|
// TODO Change files within shared folders that are renamed
|
||||||
public function opendir($path) {
|
public function opendir($path) {
|
||||||
if ($path == "" || $path == "/") {
|
if ($path == "" || $path == "/") {
|
||||||
|
|
Loading…
Reference in New Issue