Forum OpenACS Development: Autogenerating users

Collapse
Posted by Mattia Righetti on
Dear developers,

If I have a list of people in a table (name, surname, ecc...), is there a way to autogenerate usernames and passwords for OpenACS?

Thank you in advance,
Mattia

Collapse
2: Re: Autogenerating users (response to 1)
Posted by Benjamin Brink on
Hello Mattia,

from an admin user, one can use the interface at:

/acs-admin/users

click link "Add a batch of users".

Via tcl there is:

auth::create_user

cheers,
Ben

Collapse
5: Re: Autogenerating users (response to 2)
Posted by Mattia Righetti on
If I do like you suggested then I don't know the password of each user...
Collapse
3: Re: Autogenerating users (response to 1)
Posted by Neophytos Demetriou on
Try this:

SELECT acs_user__new(null, 'user', now(), null, null, null, 'someusername', 'mailto:someone@example.com'; , null, 'somefirstname' , 'somelastname' , 'somepassword' , 'somesalt' , null, 't', null );

The order of arguments is as follows: user_id,object_type, creation_date, creation_user, creation_ip, authority_id, username, email, url, first_names, last_name, password, salt, screen_name, email_verified_p, context_id

Collapse
4: Re: Autogenerating users (response to 3)
Posted by Mattia Righetti on
Yes, the problem is that the database stores the password already encrypted and I'm not sure that this function also encrypts the password...
Collapse
6: Re: Autogenerating users (response to 1)
Posted by Mattia Righetti on
Ok, I solved. Basically I copied the program user-batch-add.tcl and I modified. Now everything works. Thank you anyway!