• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/extlinks.php
  • Класс: CWebDavExtLinks
  • Вызов: CWebDavExtLinks::GetLifeTime
static function GetLifeTime($options)
{
	$n = intval($options["LIFETIME_NUMBER"]);
	$r = 0;
	$max = 315360000; //10*365*24*60*60
	if(array_key_exists("LIFETIME_TYPE", $options))
	{
		switch($options["LIFETIME_TYPE"])
		{
			case 'day':
				$r = $n*86400; //24*60*60
				break;
			case 'hour':
				$r = $n*3600; //60*60
				break;
			case 'minute':
				$r = $n*60;
				break;
			default:
				return $max;
		}
	}
	if($r <= 0 || $r > $max)
	{
		return $max;
	}
	return  $r;
}