• Модуль: dav
  • Путь к файлу: ~/bitrix/modules/dav/classes/general/principalshandler.php
  • Класс: CDavPrincipalsHandler
  • Вызов: CDavPrincipalsHandler::PropfindGroups
protected function PropfindGroups(&$arResources, $siteId, $account, $arPath, $id = null, $depth = 0)
{
	$request = $this->groupdav->GetRequest();

	if (is_null($account))
	{
		$resource = new CDavResource("/principals/group/");
		$resource->AddProperty('current-user-principal', array('href', $request->GetPrincipalUrl()));
		$resource->AddProperty('resourcetype',
			array(
				array('collection', ''),
				array('principal', '', CDavGroupDav::DAV),
			)
		);
		$arResources[] = $resource;

		if ($depth)
		{
			$arGroups = CDavAccount::GetAccountsList("group");
			foreach ($arGroups as $v)
				$this->AddGroup($arResources, $siteId, $v);
		}
	}
	else
	{
		$arGroup = CDavAccount::GetAccountById($account);
		if (!$arGroup)
			return '404 Not Found';

		$this->AddGroup($arResources, $siteId, $arGroup);
	}
	return true;		
}