You are not logged in.
Pages: 1
Hi,
I´m creating an user manually , like this:
import net.datenwerke.security.service.usermanager.entities.User
User newUser = new User();
newUser.setFirstname("test");
newUser.setLastname("test2");
newUser.setUsername("test");
newUser.setEmail("test@test");
What is the easiest way to add this user in "/usermanager/external" folder ?
I read the documentation and example for ldap legacy import, however in the example the loop is in SearchResult, like this:
for(SearchResult sr : searchResults.values()){
And I´m looping the entries, like this:
for (SearchResultEntry result1 : searchResult.getSearchEntries())
Thanks,
Offline
hi marcioribeiro,
you can search for an "ou" (organizational unit aka folder) and set this as parent of the new user
UserManagerService userManagerService = GLOBALS.getRsService(UserManagerService.class);
List<OrganisationalUnit> ouList = userManagerService.getOUsByName("myFolder");
newUser .setParent(ouList[0]);
try{
userManagerService.persist(newUser );
}catch ( Exception ex ) {
tout.println("persisting $user failed: $ex")
}
Softwareentwickler bei Infofabrik
Offline
Pages: 1