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

	if (!$this->CheckPrivileges('DAV::read', $currentPrincipal, 0))
		return '403 Forbidden';

	$requestDocument = $request->GetXmlDocument();

	if ($requestDocument->GetRoot() && $requestDocument->GetRoot()->GetTag() != 'propfind')
		return '501 Not Implemented';

	if (!is_null($arPath) && count($arPath) > 0)
	{
		if (isset($arPath[1]))
		{
			$u = CDavAccount::GetAccountByName($arPath[1]);
			$account = array($u["TYPE"], $u["ID"]);
		}

		switch ($arPath[0])
		{
			case 'user':
				$res = $this->PropfindUsers($arResources, $siteId, $account, $arPath, $id, $request->GetDepth());
				break;
			case 'group':
				$res = $this->PropfindGroups($arResources, $siteId, $account, $arPath, $id, $request->GetDepth());
				break;
			default:
				return '404 Not Found';
		}
	}
	else
	{
		$res = $this->PropfindPrincipals($arResources, $siteId);
	}

	if ($res !== true)
		return $res;

	return true;
}