$setprops = $setprops[0]->GetContent(); // <prop> $setprops = $setprops[0]->GetContent(); // the array of properties. foreach ($setprops as $k => $setting) { $tag = $setting->GetNSTag(); $content = $setting->RenderContent(0, null, true); dbg_error_log('MKCOL', 'Processing tag "%s"', $tag); switch ($tag) { case 'DAV::resourcetype': /** Any value for resourcetype other than 'calendar' is ignored */ dbg_error_log('MKCOL', 'Extended MKCOL with resourcetype specified. "%s"', $content); $is_addressbook = count($setting->GetPath('DAV::resourcetype/urn:ietf:params:xml:ns:carddav:addressbook')); $is_calendar = count($setting->GetPath('DAV::resourcetype/urn:ietf:params:xml:ns:caldav:calendar')); if ($is_addressbook && $is_calendar) { $failure['set-' . $tag] = new XMLElement('propstat', array(new XMLElement('prop', new XMLElement($reply->Tag($tag))), new XMLElement('status', 'HTTP/1.1 409 Conflict'), new XMLElement('responsedescription', translate('Collections may not be both CalDAV calendars and CardDAV addressbooks at the same time')))); } else { $resourcetypes = $setting->GetPath('DAV::resourcetype/*'); $types = ''; foreach ($resourcetypes as $k => $v) { $types .= '<' . $v->GetNSTag() . '/>'; } $resourcetypes = $types; $success[$tag] = 1; } break; case 'DAV::displayname': $displayname = $content; /** * @todo This is definitely a bug in SOHO Organizer and we probably should respond * with an error, rather than silently doing what they *seem* to want us to do.