Creating new users automatically (userGroups)


I’m developing an application that allow some admin user to create profiles for doctors, but to do that I user a registration form i’ve created not the userGroups new users creation page.

I want every time this admin creates a new doctor profile, my application AUTOMATICALLY creates a new user account for him.

Example: the admin user just have created a new profile for John smith. My application should create a user called johnsmith and a password johnsmith.

The problem is when I put this data into usergroups_user table (created by userGroups during it’s instalation), i can’t login using johnsmith username and passwrord. I get “wrong username or password” message.

Can anybody help me?