Ejemplo n.º 1
0
 /**
  * This method allows us to intercept the 'mkcalendar' sabreAction. This
  * action enables the user to create new calendars from the browser plugin.
  *
  * @param string $uri
  * @param string $action
  * @param array $postVars
  * @return bool
  */
 public function browserPostAction($uri, $action, array $postVars)
 {
     if ($action !== 'mkaddressbook') {
         return;
     }
     $resourceType = array('{DAV:}collection', '{urn:ietf:params:xml:ns:carddav}addressbook');
     $properties = array();
     if (isset($postVars['{DAV:}displayname'])) {
         $properties['{DAV:}displayname'] = $postVars['{DAV:}displayname'];
     }
     $this->server->createCollection($uri . '/' . $postVars['name'], $resourceType, $properties);
     return false;
 }