1
Mamba
Adding users in bulk via SQL
  • 2004/6/4 6:39

  • Mamba

  • Moderator

  • Posts: 11367

  • Since: 2004/4/23


I have a mailing list with over 1000 names. What is the best way to add them as users?

I've tried, but it seems like they are not registered, i.e. they can log in to change their profile (e.g. password), but when they login, the system tells them that they have no access rights and goes to registration module.

Any ideas?

2
Mithrandir
Re: Adding users in bulk via SQL

just adding them to the users table will not do much. They need to be added to the registered user's group, too.

Do a little search with "user", "group" and "link" and I hope, you'll find a similar thread, where we discussed the SQL and table entries needed for this.

3
Mamba
Re: Adding users in bulk via SQL
  • 2004/6/4 12:40

  • Mamba

  • Moderator

  • Posts: 11367

  • Since: 2004/4/23


Thanks for the tip.

I didn't find the thread, but I just created the needed records in "groups_users_link" table and it seems to work now.

4
dplittle
Re: Adding users in bulk via SQL
  • 2004/9/17 19:01

  • dplittle

  • Just popping in

  • Posts: 49

  • Since: 2004/9/15


Quote:

Salsero wrote:
I've tried, but it seems like they are not registered, i.e. they can log in to change their profile (e.g. password)


How did you handle the initial passwords when you did the bulk load?

Thanks

David

5
Mamba
Re: Adding users in bulk via SQL
  • 2004/9/17 19:11

  • Mamba

  • Moderator

  • Posts: 11367

  • Since: 2004/4/23


Quote:

How did you handle the initial passwords when you did the bulk load?


I generated passwords for all of them and asked the people to modify it.

6
dplittle
Re: Adding users in bulk via SQL
  • 2004/9/17 19:23

  • dplittle

  • Just popping in

  • Posts: 49

  • Since: 2004/9/15


Quote:

Salsero wrote:
I generated passwords for all of them and asked the people to modify it.


I was more interested in how you added the password during the bulk add. Did you just generate one account, copy the hashed password and then use the same string for all the users?

7
Dave_L
Re: Adding users in bulk via SQL
  • 2004/9/17 20:56

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


I don't know if this is how Salsero did it, but here's a way of generating a unique MD5 hash for the encoded password:

$pw = md5(uniqid(mt_rand(), true));

So you could easily generate a different password for each user, and if the user's email address is correct, he can use the "Lost Password" link to generate a new password so he can login.

8
Mamba
Re: Adding users in bulk via SQL
  • 2004/9/17 21:02

  • Mamba

  • Moderator

  • Posts: 11367

  • Since: 2004/4/23


Quote:

I was more interested in how you added the password during the bulk add. Did you just generate one account, copy the hashed password and then use the same string for all the users?


I generated several of the accounts/passwords and then alternated them for the users.

But David's method is probably the best.

9
dplittle
Re: Adding users in bulk via SQL
  • 2004/9/17 21:13

  • dplittle

  • Just popping in

  • Posts: 49

  • Since: 2004/9/15


Quote:

Dave_L wrote:

$pw = md5(uniqid(mt_rand(), true));




Thanks Dave ... that will work great unless I'm doing a bulk upload of a CSV file. I tried creating a user with a generic password and then using that for all the users but it didn't seem to work. Now I'm just creating them with a garbage password and having everyone do the "Lost Password" approach (except the boss of course...fixed his by hand ).

I just created all the users and am now doing a "Mail User" mailing to everyone and tell them how to create a new password.

Thanks again

David

Login

Who's Online

128 user(s) are online (98 user(s) are browsing Support Forums)


Members: 0


Guests: 128


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits