0011264: Fetch Exception when Client tries to delete system folder
authorCornelius Weiß <mail@corneliusweiss.de>
Tue, 25 Aug 2015 12:40:27 +0000 (14:40 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 27 Aug 2015 12:25:34 +0000 (14:25 +0200)
* Tinebase_Exception_Record_SystemContainer ->
  Sabre\DAV\Exception\Forbidden

Change-Id: Id86ff21fb46e5331fe0416d3da49c2581d3f8b4b
Reviewed-on: http://gerrit.tine20.com/customers/2130
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Container.php
tine20/Tinebase/WebDav/Container/Abstract.php

index 6d7a79b..760e39c 100644 (file)
@@ -998,6 +998,7 @@ class Tinebase_Container extends Tinebase_Backend_Sql_Abstract
      * @param   boolean $_ignoreAcl
      * @param   boolean $_tryAgain
      * @throws  Tinebase_Exception_AccessDenied
+     * @throws  Tinebase_Exception_Record_SystemContainer
      * @throws  Tinebase_Exception_InvalidArgument
      * 
      * @todo move records in deleted container to personal container?
index 9e77434..e57c45e 100644 (file)
@@ -78,6 +78,13 @@ abstract class Tinebase_WebDav_Container_Abstract extends \Sabre\DAV\Collection
             Tinebase_Container::getInstance()->deleteContainer($this->_container);
         } catch (Tinebase_Exception_AccessDenied $tead) {
             throw new Sabre\DAV\Exception\Forbidden('Permission denied to delete node');
+        } catch (Tinebase_Exception_Record_SystemContainer $ters) {
+            throw new Sabre\DAV\Exception\Forbidden('Permission denied to delete system container');
+        } catch (Exception $e) {
+            if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE))
+                Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ . ' failed to delete container ' .$this->_container->getId() . "\n$e" );
+
+            throw new \Sabre\DAV\Exception($e->getMessage());
         }
     }