Commit b858a91dff0995afb6eadaa10601303640684adf
Merge branch 'edge'
Conflicts: ktwebdav/lib/KTWebDAVServer.inc.php
Showing
1 changed file
with
15 additions
and
7 deletions
ktwebdav/lib/KTWebDAVServer.inc.php
| ... | ... | @@ -346,12 +346,20 @@ class KTWebDAVServer extends HTTP_WebDAV_Server |
| 346 | 346 | // are sent in the response without any message-body |
| 347 | 347 | $method = 'get'; |
| 348 | 348 | } |
| 349 | - // stub out lock and unlock to get Finder working | |
| 350 | - if (($method == 'lock') || ($method == 'unlock')) { | |
| 351 | - $this->ktwebdavLog("Skipping $method request", 'info', true); | |
| 352 | - $this->http_status("200 OK"); | |
| 353 | - } else { | |
| 354 | - $this->ktwebdavLog("Entering $method request", 'info', true); | |
| 349 | + $this->ktwebdavLog("Entering $method request", 'info', true); | |
| 350 | + | |
| 351 | + if (method_exists($this, $wrapper) && ($method == 'options' || method_exists($this, $method))) { | |
| 352 | + $this->$wrapper(); // call method by name | |
| 353 | + } else { // method not found/implemented | |
| 354 | + if ($_SERVER['REQUEST_METHOD'] == 'LOCK') { | |
| 355 | + $this->http_status('412 Precondition failed'); | |
| 356 | + } else { | |
| 357 | + $this->http_status('405 Method not allowed'); | |
| 358 | + header('Allow: '.join(', ', $this->_allow())); // tell client what's allowed | |
| 359 | + } | |
| 360 | + } | |
| 361 | + | |
| 362 | + $this->ktwebdavLog("Exiting $method request", 'info', true); | |
| 355 | 363 | |
| 356 | 364 | if (method_exists($this, $wrapper) && ($method == 'options' || method_exists($this, $method))) { |
| 357 | 365 | $this->$wrapper(); // call method by name |
| ... | ... | @@ -371,7 +379,7 @@ $this->ktwebdavLog("Exiting $method request", 'info', true); |
| 371 | 379 | * check authentication if check is implemented |
| 372 | 380 | * |
| 373 | 381 | * @param void |
| 374 | - * @return bool true if authentication succeeded or not necessary | |
| 382 | + * @return bool true if authentication succeded or not necessary | |
| 375 | 383 | */ |
| 376 | 384 | function _check_auth() |
| 377 | 385 | { | ... | ... |