• Модуль: mobile
  • Путь к файлу: ~/bitrix/modules/mobile/lib/auth.php
  • Класс: BitrixMobileAuth
  • Вызов: Auth::removeOneTimeAuthHash
static function removeOneTimeAuthHash($hash = null)
{
	if(!empty($hash))
	{
		global $DB;
		global $USER;

		$userId = $USER->getId();
		if ($userId > 0)
		{
			$hash = $DB->ForSql($hash);
			$where = "URL = '/mobile/' AND USER_ID=${userId} AND HASH='${hash}'";
			/** @var CDBResult $dbResult */
			$dbResult = $DB->Query("DELETE FROM b_user_hit_auth WHERE ${where}");
			if ($dbResult->result && $dbResult->AffectedRowsCount())
			{
				$handlers = EventManager::getInstance()->findEventHandlers('mobile', 'oneTimeHashRemoved');
				foreach ($handlers as $handler) {
					ExecuteModuleEventEx($handler, array($userId, $hash));
				}

				return true;
			}
		}
	}

	return false;
}