Executing scripts via url to add new users

Hi,

The comment above the method says to use UserManagerService.setPassword method (implemented in UserManagerServiceImpl)

Karolina

To summarize:

You can use the following script to set the password: (remember to use the -c flag when executing the script)

import net.datenwerke.security.service.usermanager.UserManagerService;
import net.datenwerke.security.service.usermanager.entities.User;
import net.datenwerke.security.service.usermanager.entities.OrganisationalUnit;

UserManagerService userManagerService = GLOBALS.getRsService(UserManagerService.class);


/* create user */
User user = new User();
user.setUsername("sampleUser");
user.setFirstname("Sample");
user.setLastname("Test");
		
		
List<OrganisationalUnit> ouList = userManagerService.getOUsByName("Administration");
for (OrganisationalUnit ou: ouList) {
	ou.addChild(user);
}
userManagerService.persist(user);
		
userManagerService.setPassword(user, "abcdef");

"User created";

Cheers,
Eduardo