From 401183780540812929e35a59348b7f2e347d4b8f Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 7 Jan 2014 18:47:33 -0800 Subject: more work on dav - deletion and a bit more progress on OS storage --- include/reddav.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'include/reddav.php') 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']); } } -- cgit v1.2.3