• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/access.php
  • Класс: CAccess
  • Вызов: CAccess::AddCode
static function AddCode($userId, $provider, $code)
{
	$userId = (int)$userId;

	$connection = MainApplication::getConnection();
	$helper = $connection->getSqlHelper();

	$connection->query("
		INSERT INTO b_user_access (USER_ID, PROVIDER_ID, ACCESS_CODE)
		VALUES ({$userId}, '{$helper->forSql($provider)}', '{$helper->forSql($code)}')
	");

	static::ClearCache($userId);
}