aboutsummaryrefslogtreecommitdiffstats
path: root/include/reddav.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-07 18:47:33 -0800
committerfriendica <info@friendica.com>2014-01-07 18:47:33 -0800
commit401183780540812929e35a59348b7f2e347d4b8f (patch)
tree4df2d28c28a0d7af35419ed57f983cc306a674d5 /include/reddav.php
parentb8564134aaffc2ebe35fecd5dae4fd0f6523eb53 (diff)
downloadvolse-hubzilla-401183780540812929e35a59348b7f2e347d4b8f.tar.gz
volse-hubzilla-401183780540812929e35a59348b7f2e347d4b8f.tar.bz2
volse-hubzilla-401183780540812929e35a59348b7f2e347d4b8f.zip
more work on dav - deletion and a bit more progress on OS storage
Diffstat (limited to 'include/reddav.php')
-rw-r--r--include/reddav.php17
1 files changed, 5 insertions, 12 deletions
diff --git a/include/reddav.php b/include/reddav.php
index 3bf670711..62208368c 100644
--- a/include/reddav.php
+++ b/include/reddav.php
@@ -21,7 +21,7 @@ class RedDirectory extends DAV\Node implements DAV\ICollection {
if(! $this->red_path)
$this->red_path = '/';
$this->auth = $auth_plugin;
- logger('Red_Directory: ' . print_r($this,true));
+// logger('Red_Directory: ' . print_r($this,true));
$this->folder_hash = '';
$this->getDir();
@@ -414,19 +414,12 @@ class RedFile extends DAV\Node implements DAV\IFile {
function delete() {
- if($this->data['flags'] & ATTACH_FLAG_OS) {
- // FIXME delete physical file
- }
- if($this->data['flags'] & ATTACH_FLAG_DIR) {
- // FIXME delete contents (recursive?)
+ if((! $this->auth->owner_id) || (! perm_is_allowed($this->auth->owner_id,$this->auth->observer,'write_storage'))) {
+ throw new DAV\Exception\Forbidden('Permission denied.');
+ return;
}
-
-// q("delete from attach where id = %d limit 1",
-// intval($this->data['id'])
-// );
-
-
+ attach_delete($this->auth->owner_id,$this->data['hash']);
}
}