• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/ui/uploader/uploader.php
  • Класс: BitrixMainUIUploaderUploader
  • Вызов: Uploader::fillRequireData
protected function fillRequireData()
{
	$this->mode = $this->getRequest("mode");
	if (!in_array($this->mode, array("upload", "delete", "view")))
		throw new ArgumentOutOfRangeException("mode");

	if ($this->mode != "view" && !check_bitrix_sessid())
		throw new AccessDeniedException("Bad sessid.");

	$this->version = (int) $this->getRequest("version");

	$directory = CBXVirtualIo::GetInstance()->GetDirectory($this->path);
	$directoryExists = $directory->IsExists();
	if (!$directory->Create())
		throw new NotImplementedException("Mandatory directory has not been created.");
	if (!$directoryExists)
	{
		$access = CBXVirtualIo::GetInstance()->GetFile($directory->GetPath()."/.access.php");
		$content = 'GetName().'"]["*"]="X";?>';

		if (!$access->IsExists() || mb_strpos($access->GetContents(), $content) === false)
		{
			if (($fd = $access->Open('ab')))
			{
				fwrite($fd, $content);
			}
			fclose($fd);
		}
	}

	return false;
}