File dav/method/DELETE.class.php

Last commit: Thu Nov 7 22:23:10 2019 +0100	Jan Dankert	New: Delete objects.
1 <?php 2 3 class DAV_DELETE extends DAV 4 { 5 6 7 /** 8 * Deletion. 9 */ 10 public function execute() 11 { 12 if ( $this->readonly ) 13 { 14 $this->httpForbidden(); // Kein Schreibzugriff erlaubt 15 } 16 else 17 { 18 if ( ! $this->request->exists() ) 19 { 20 // Nicht existente URIs kann man auch nicht loeschen. 21 $this->httpStatus('404 Not Found' ); 22 } 23 else 24 { 25 switch( $this->request->type ) 26 { 27 case URIParser::ROOT: 28 $this->httpForbidden(); 29 break; 30 31 case URIParser::PROJECT: 32 // Dangerous - but possible. 33 $this->client->projectDelete($this->request->projectid); 34 break; 35 36 case URIParser::FOLDER: 37 $this->client->folderDelete($this->request->objectid); 38 break; 39 40 case 'page': 41 $this->client->pageDelete($this->request->objectid); 42 break; 43 44 case 'file': 45 $this->client->fileDelete($this->request->objectid); 46 break; 47 48 case 'image': 49 $this->client->imageDelete($this->request->objectid); 50 break; 51 52 case 'text': 53 $this->client->textDelete($this->request->objectid); 54 break; 55 56 default: 57 $this->httpForbidden(); 58 } 59 } 60 61 } 62 } 63 64 }
Download dav/method/DELETE.class.php
History Thu, 7 Nov 2019 22:23:10 +0100 Jan Dankert New: Delete objects. Mon, 4 Nov 2019 23:56:38 +0100 Jan Dankert Refactoring: Renaming WebDAV to DAV base class. Mon, 4 Nov 2019 23:54:13 +0100 Jan Dankert Refactoring: Splitting DAV methods into single files.