- Модуль: dav
- Путь к файлу: ~/bitrix/modules/dav/classes/general/addressbookbase.php
- Класс: ofCDavAddressbookBase
- Вызов: CDavAddressbookBase::Propfind
public function Propfind(&$arDavResources, $collectionId, $account, $arPath, $id = null)
{
if ($collectionId == null)
return '404 Not Found';
$request = $this->groupdav->GetRequest();
$currentPrincipal = $request->GetPrincipal();
if (!$this->CheckPrivileges('DAV:read', $currentPrincipal, $collectionId))
return '403 Forbidden';
$requestDocument = $request->GetXmlDocument();
if (($id || $requestDocument->GetRoot() && $requestDocument->GetRoot()->GetTag() != 'propfind') && !$this->LoadFilters($id))
return false;
$path = CDav::CheckIfRightSlashAdded($request->GetPath());
if ($this->IsResourcePath($path))
{
$filter = $this->LoadFilters($id);
$entities = $this->LoadEntities($collectionId, $account, $filter);
foreach ($entities as $entity)
{
$resource = new CDavResource($path . $this->GetPath($entity));
$resource->AddProperty('getetag', $this->GetETag($collectionId, $entity));
$resource->AddProperty('getcontenttype', 'text/vcard');
$resource->AddProperty('getlastmodified', MakeTimeStamp($this->EntityLastModifiedAt($entity)));
$resource->AddProperty('resourcetype', '');
if ($this->IsAddressData($request))
{
$content = $this->GetVCardContent($entity);
$resource->AddProperty('getcontentlength', mb_strlen($content));
$resource->AddProperty('address-data', $content, CDavGroupDav::CARDDAV);
}
else
{
$resource->AddProperty('getcontentlength', "");
}
$arDavResources[] = $resource;
}
}
return true;
}