• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/diskdispatcher.php
  • Класс: CWebDavDiskDispatcher
  • Вызов: CWebDavDiskDispatcher::findOwnerIdSection
static function findOwnerIdSection(array $section, $returnUserAndSection = false)
{
	if(isset($section['DEPTH_LEVEL']) && $section['DEPTH_LEVEL'] == 1)
	{
		$sectionOwnerElement = $section;
	}
	else
	{
		//todo so normally to look for root section?
		$sectionOwnerElement = CIBlockSection::GetList(array('LEFT_MARGIN' => 'DESC'), array(
			'IBLOCK_ID'         => $section['IBLOCK_ID'],
			'DEPTH_LEVEL'       => 1,
			'IBLOCK_SECTION_ID' => null,
			'!LEFT_MARGIN'      => $section['LEFT_MARGIN'],
			'!RIGHT_MARGIN'     => $section['RIGHT_MARGIN'],
		), false, array('ID', 'IBLOCK_ID', 'IBLOCK_SECTION_ID', 'CREATED_BY', 'NAME'))->fetch();
	}
	//$user = CUser::GetById($sectionOwnerElement['CREATED_BY'])->fetch();
	if(empty($sectionOwnerElement))
		return false;

	return !$returnUserAndSection? $sectionOwnerElement['CREATED_BY'] : array($sectionOwnerElement['CREATED_BY'], $sectionOwnerElement);
}