Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Bulk Import of Users


Reply


3 Posts   3716 Views

Avatar
artlung

Community Member, 10 Posts

9 October 2008 at 1:01pm

Is there a tool to Bulk load users into the Users and User_Groups tables?

Ideally I'd like to upload a csv file containing FirstName, Surname, Email, Password and have the users added if they are not in the user database already, and add them to whatever group I specify.

Nice to have would be making Password optional and auto-generating passwords.

Anyone build anything like this? Or have thoughts on how to go about building it as an add-on?

Avatar
banal

Community Member, 901 Posts

9 October 2008 at 8:31pm

There's a csv import for the newsletter mailing list. Maybe you can simply alter that code and use it for your user import. I guess there shouldn't be too much to change, since the newsletter subscribers are basically users as well

Avatar
erwanpia

Community Member, 63 Posts

25 November 2008 at 4:43am

Edited: 25/11/2008 4:44am

Hi, you will find in the attached files my own implentation of bulk users import, directly duplicated from the code in newsletter ( [url=http://www.webmasterbulletin.net/2008/11/silverstripe-howto-import-group-users/496]screenshot here [/url])

place the following in cms/code
SecurityAdmin.php (replace)
SecurityImportField.php (new)

and place the following in cms/templates (both new)
Security_RecipientImportField.ss
Security_RecipientImportField_Table.ss

tested on 2.2.3

don't know yet if it can import password too, to be tested, let me know how it goes for you

[edit] : do attached files work on this forum ? if not [url=http://www.webmasterbulletin.net/2008/11/silverstripe-howto-import-group-users/496]download here.[/url]