#1 2024-10-16 10:01:18

eugenev
Member
Registered: 2024-10-16

Can't activate the user using script

Hi everyone, I'm trying to activate the user using groovy script. I've tried different ways, but every time I've got the same error:

Script execution failed.
error message: javax.script.ScriptException: java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 12 (java.lang.StringIndexOutOfBoundsException)
script arguments:
file: t.groovy (id: 60335012, line 11)
line number: 11

Is anybody have a thoughts how to do this? Thanks
I'm using the following code:

import net.datenwerke.rs.passwordpolicy.service.activateuser.ActivateUserService
import net.datenwerke.security.service.usermanager.UserManagerService
import net.datenwerke.rs.passwordpolicy.service.BsiPasswordPolicyService

def userManagerService = GLOBALS.getRsService(UserManagerService.class)
def activateUserService = GLOBALS.getInstance(ActivateUserService)
def bsiPasswordPolicyService = GLOBALS.getInstance(BsiPasswordPolicyService)

def us = userManagerService.getUserByName('testtest')

activateUserService.activateAccount(us)

Last edited by eugenev (2024-10-16 11:03:00)

Offline

#2 2024-11-14 11:42:45

adrian1703
Moderator
Registered: 2021-10-29

Re: Can't activate the user using script

Hello,

I can in fact reproduce this bug. We have raised the issue RS-8735 to look further into it.

Kind regards,
Adrian

Offline

Board footer

Powered by FluxBB