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

	if($this->code->getDateSent())
	{
		if(($currentDateTime->getTimestamp() - $this->code->getDateSent()->getTimestamp()) > $this->checkInterval*2)
		{
			//reset attempts only for the new code (when time passes)
			$this->code->setAttempts(0);
			$this->code->setDateSent(null);
		}
	}

	if(!$this->code->getDateSent())
	{
		//first time only
		$this->code->setDateSent($currentDateTime);
	}
	$this->code->setDateResent($currentDateTime);

	$this->code->save();

	return true;
}