• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/authentication/shortcode.php
  • Класс: BitrixMainAuthenticationShortCode
  • Вызов: ShortCode::checkDateSent
public function checkDateSent()
{
	$result = new MainResult();

	$resultData = [
		"checkInterval" => $this->checkInterval*2,
		"resendInterval" => $this->resendInterval,
	];

	//alowed only once in a interval
	if($this->code->getDateResent())
	{
		$currentDateTime = new MainTypeDateTime();
		$interval = $currentDateTime->getTimestamp() - $this->code->getDateResent()->getTimestamp();

		if($interval < $this->resendInterval)
		{
			$resultData["secondsLeft"] = $this->resendInterval - $interval;
			$resultData["secondsPassed"] = $interval;
			$result->addError(new MainError("Timeout not expired yet."));
		}
	}

	$result->setData($resultData);

	return $result;
}