/** * principalPropertySearchReport * * This method is responsible for handing the * {DAV:}principal-property-search report. This report can be used for * clients to search for groups of principals, based on the value of one * or more properties. * * @param string $path * @param Xml\Request\PrincipalPropertySearchReport $report * @return void */ protected function principalPropertySearchReport($path, Xml\Request\PrincipalPropertySearchReport $report) { if ($report->applyToPrincipalCollectionSet) { $path = null; } if ($this->server->getHttpDepth('0') !== 0) { throw new BadRequest('Depth must be 0'); } $result = $this->principalSearch($report->searchProperties, $report->properties, $path, $report->test); $prefer = $this->server->getHTTPPrefer(); $this->server->httpResponse->setStatus(207); $this->server->httpResponse->setHeader('Content-Type', 'application/xml; charset=utf-8'); $this->server->httpResponse->setHeader('Vary', 'Brief,Prefer'); $this->server->httpResponse->setBody($this->server->generateMultiStatus($result, $prefer['return'] === 'minimal')); }