• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/iblock.php
  • Класс: CWebDavIblock
  • Вызов: CWebDavIblock::CheckRights
function CheckRights($method = "", $strong = false, $path = "")
{
	$result = true;
	if (!parent::CheckRights($method, $strong))
	{
		$result = false;
		$errorCode = (parent::CheckRights($method, $strong, true));
		$GLOBALS["APPLICATION"]->ThrowException(GetMessage('WD_ACCESS_DENIED'), (!!$errorCode ? $errorCode : 'ACCESS_DENIED'), __LINE__);
	}
	elseif (!empty($path))
	{
		$path = $this->_udecode($path);
		$strFileName = basename($path);
		$extention = mb_strtolower(strrchr($strFileName, '.'));
		if (in_array($method, array("COPY", "MOVE", "PUT")))
		{
			if (IsFileUnsafe($strFileName) || $strFileName == "index.php")
			{
				$result = false;
				$GLOBALS['APPLICATION']->ThrowException(GetMessage("WD_FILE_ERROR14"), "FORBIDDEN_NAME", __LINE__);
			}
		}
	}
	return $result;
}