• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/classes/general/vi_rest.php
  • Класс: CVoxImplantRestService
  • Вызов: CVoxImplantRestService::deactivatePhone
static function deactivatePhone($params, $n, $server)
{
	$params['USER_ID'] ??= null;

	$userId = (int)$params['USER_ID'];
	if ($userId === 0)
	{
		throw new BitrixRestRestException('Parameter USER_ID is not set');
	}

	$permissions = SecurityPermissions::createWithCurrentUser();
	if (!CVoxImplantUser::canModify($userId, $permissions))
	{
		throw new BitrixRestRestException('You are not allowed to modify user's settings');
	}

	$user = new CVoxImplantUser();
	$user->SetPhoneActive($userId, true);

	return 1;
}