• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/file.php
  • Класс: CWebDavFile
  • Вызов: CWebDavFile::checkLock
function checkLock($path)
{
	$result = false;
	$is_dir = false;
	$ID = 0;
	$strProps = "";

	$this->IsDir(array("path" => $path));
	if ($this->arParams["not_found"] === true)
	{
		return "404 Not Found";
	}

	$arProps = $this->_get_props($this->arParams["item_id"]);

	if (
		!empty($arProps["LOCK"])
		&& is_array($arProps["LOCK"])
	)
	{
		$res = reset($arProps["LOCK"]);

		$result = array(
			"type"	  => "write",
			"scope"   => $res["exclusivelock"] ? "exclusive" : "shared",
			"depth"   => 0,
			"owner"   => $res["owner"],
			"token" => $res["token"],
			"created" => $res["created"],
			"modified" => $res["modified"],
			"expires" => $res["expires"]
		);
	}

	return $result;
}