• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/general.php
  • Класс: CWebDavBase
  • Вызов: CWebDavBase::MetaNames
function MetaNames(&$res, $strict = false)
{
	static $hideSystemFiles = null;
	foreach($this->meta_names as $metaName => $metaArr)
	{
		if ($res["NAME"] == $metaArr["name"])
		{
			$res["~NAME"] = $res["NAME"];
			$res["NAME"] = $metaArr["alias"];
			if ($this->Type === "folder")
			{
				$arPath = explode("/", $res["PATH"]);
				$arPath[sizeof($arPath)-1] = $metaArr["alias"];
				$res["PATH"] = implode("/", $arPath);
			}
			elseif ($this->Type == "iblock" && $this->e_rights)
			{
				if($metaName == self::TRASH)
				{
					return (($this->arRootSection !== false) ?
						$this->GetPermission('SECTION', $this->arRootSection['ID'], 'section_rights_edit') :
						$this->GetPermission('IBLOCK', $this->IBLOCK_ID, 'iblock_rights_edit'));
				}
				else
				{
					return (($this->arRootSection !== false) ?
						$this->GetPermission('SECTION', $this->arRootSection['ID'], 'section_read') :
						$this->GetPermission('IBLOCK', $this->IBLOCK_ID, 'element_read'));
				}

			}
			return ($this->permission >= $metaArr["rights"]);
		}
	}
	if ($hideSystemFiles === null)
		$hideSystemFiles = (COption::GetOptionString("webdav", "hide_system_files", "Y") == "Y");

	if ((mb_strpos($_SERVER['HTTP_USER_AGENT'], "WebDAVFS/1") !== false) &&
		(mb_strpos($_SERVER['HTTP_USER_AGENT'], "Darwin/") !== false) &&
		($strict === false)
	) // mac os x 10.7
		$hideSystemFiles = false;

	if ((preg_match('/^..*/', $res['NAME']) !== 0) && $hideSystemFiles)
		return false;

	return true;
}