• Модуль: dav
  • Путь к файлу: ~/bitrix/modules/dav/classes/general/addressbookhandler.php
  • Класс: CDavAddressbookHandler
  • Вызов: CDavAddressbookHandler::GetCollectionProperties
public function GetCollectionProperties(CDavResource $resource, $siteId, $account = null, $currentApplication = null, $arPath = null, $options = 0)
{
	$collectionId = $this->GetCollectionId($siteId, $account, $arPath);
	if ($collectionId == null)
		return false;
	$request = $this->groupdav->GetRequest();
	$currentPrincipal = $request->GetPrincipal();
	$homeUrl = $this->GetHomeCollectionUrl($siteId, $account, $arPath);

	$resource->AddProperty('addressbook-home-set', array('href', $request->GetBaseUri() . $homeUrl), CDavGroupDav::CARDDAV);
	if ($currentApplication == "addressbook")
	{
		if ($this->IsMacAgent())
		{
			if (!$this->GetDefaultResourceProvider()->CheckPrivileges('DAV:read', $currentPrincipal, $collectionId))
				return '403 Access denied';
			$this->GetDefaultResourceProvider()->GetAddressbookProperties($resource, $collectionId, $account, $arPath, $options);
		}
		else
		{
			if (!empty($arPath[0]) && isset($this->addressbookCollections[$arPath[0]]))
			{
				if (!$this->addressbookCollections[$arPath[0]]->CheckPrivileges('DAV:read', $currentPrincipal, $collectionId))
					return '403 Access denied';
				$this->addressbookCollections[$arPath[0]]->GetAddressbookProperties($resource, $collectionId, $account, $arPath, $options);
			}
			else
			{
				$this->GetAddressbookProperties($resource, $collectionId, $account, $arPath, $options);
			}
		}
	}

}