diff options
author | mrjive <mrjive@mrjive.it> | 2015-11-11 16:51:48 +0100 |
---|---|---|
committer | mrjive <mrjive@mrjive.it> | 2015-11-11 16:51:48 +0100 |
commit | 53a796afcc0cff6f9e3f51457df4506a43db1945 (patch) | |
tree | a2366c48e0dae047b052283cc44284224369c8cd /include/RedDAV/RedDirectory.php | |
parent | a4c3058f845a1c38d06b2201a10700c5f878366d (diff) | |
parent | bc7c0ed844711e81c4bc642e3024849195a48421 (diff) | |
download | volse-hubzilla-53a796afcc0cff6f9e3f51457df4506a43db1945.tar.gz volse-hubzilla-53a796afcc0cff6f9e3f51457df4506a43db1945.tar.bz2 volse-hubzilla-53a796afcc0cff6f9e3f51457df4506a43db1945.zip |
Merge pull request #8 from redmatrix/master
get fresh code from HZ base
Diffstat (limited to 'include/RedDAV/RedDirectory.php')
-rw-r--r-- | include/RedDAV/RedDirectory.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/include/RedDAV/RedDirectory.php b/include/RedDAV/RedDirectory.php index 507fde46f..8d8af5bd3 100644 --- a/include/RedDAV/RedDirectory.php +++ b/include/RedDAV/RedDirectory.php @@ -251,7 +251,7 @@ class RedDirectory extends DAV\Node implements DAV\ICollection, DAV\IQuota { intval($filesize), intval(0), intval($is_photo), - dbesc($this->os_path . '/' . $hash), + dbesc($f), dbesc(datetime_convert()), dbesc(datetime_convert()), dbesc($allow_cid), @@ -363,6 +363,27 @@ class RedDirectory extends DAV\Node implements DAV\ICollection, DAV\IQuota { } /** + * @brief delete directory + */ + + public function delete() { + logger('delete file ' . basename($this->red_path), LOGGER_DEBUG); + + if ((! $this->auth->owner_id) || (! perm_is_allowed($this->auth->owner_id, $this->auth->observer, 'write_storage'))) { + throw new DAV\Exception\Forbidden('Permission denied.'); + } + + if ($this->auth->owner_id !== $this->auth->channel_id) { + if (($this->auth->observer !== $this->data['creator']) || intval($this->data['is_dir'])) { + throw new DAV\Exception\Forbidden('Permission denied.'); + } + } + + attach_delete($this->auth->owner_id, $this->folder_hash); + } + + + /** * @brief Checks if a child exists. * * @param string $name |