prevent xDAV clients to change the container displayname to id/uuid
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 4 Feb 2015 12:27:37 +0000 (13:27 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 4 Feb 2015 17:02:58 +0000 (18:02 +0100)
Change-Id: I33a310c7f52b1f9fc16b828ad53e3caffa56f843
Reviewed-on: http://gerrit.tine20.com/customers/1607
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/WebDav/Container/Abstract.php

index cbb66e7..9e77434 100644 (file)
@@ -423,20 +423,19 @@ abstract class Tinebase_WebDav_Container_Abstract extends \Sabre\DAV\Collection
         foreach ($mutations as $key => $value) {
             switch ($key) {
                 case '{DAV:}displayname':
-                    if ($value === $this->_container->uuid) {
-                        if (Tinebase_Core::isLogLevel(Zend_Log::ERR)) Tinebase_Core::getLogger()->err(__METHOD__ . '::' . __LINE__ 
-                            . ' It is not allowed to overwrite the name with the uuid');
-                        if (Tinebase_Core::isLogLevel(Zend_Log::ERR)) Tinebase_Core::getLogger()->err(__METHOD__ . '::' . __LINE__ 
+                    if ($value === $this->_container->uuid || $value === $this->_container->getId()) {
+                        if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ 
+                            . ' It is not allowed to overwrite the name with the uuid/id');
+                        if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ 
                             . ' ' . print_r(array(
                                 'useIdAsName' => $this->_useIdAsName,
                                 'container'   => $this->_container->toArray(),
                                 'new value'   => $value
                             ), true));
-                        $result['403'][$key] = null;
                     } else {
                         $this->_container->name = $value;
-                        $result['200'][$key] = null;
                     }
+                    $result['200'][$key] = null;
                     break;
                     
                 case '{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}calendar-description':