File dav/method/MKCOL.class.php
Last commit: Wed Nov 6 23:55:30 2019 +0100 Jan Dankert Fixes for uploading files.
1 <?php 2 3 class DAV_MKCOL extends DAV 4 { 5 6 /** 7 * Verzeichnis anlegen. 8 */ 9 public function execute() 10 { 11 12 if ( $this->data ) 13 { 14 $this->httpStatus('415 Unsupported Media Type' ); // Kein Body erlaubt 15 } 16 elseif ( $this->readonly ) 17 { 18 $this->httpForbidden(); // Kein Schreibzugriff erlaubt 19 } 20 elseif ( $this->request->type == URIParser::PROJECT && ! $this->request->exists() ) 21 { 22 // Create a new empty project. 23 $this->client->projectAdd( $this->request->basename); 24 } 25 elseif ( $this->request->type == URIParser::FOLDER && ! $this->request->exists() ) 26 { 27 // Create a new folder 28 $this->client->folderAdd( $this->request->folderid, $this->request->basename ); 29 $this->httpStatus('201 Created'); 30 } 31 elseif ( $this->request->exists() ) 32 { 33 // MKCOL ist nicht moeglich, wenn die URI schon existiert. 34 Logger::warn('MKCOL-Request to an existing resource'); 35 $this->httpMethodNotAllowed(); 36 } 37 else 38 { 39 Logger::warn('MKCOL failed'); 40 throw new InalidArgumentException('Unknown type'); 41 } 42 } 43 44 }
Downloaddav/method/MKCOL.class.php
History Wed, 6 Nov 2019 23:55:30 +0100 Jan Dankert Fixes for uploading files. Wed, 6 Nov 2019 23:21:38 +0100 Jan Dankert Fix: Enable creation of projects and folders. 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.