I'm nidhin
I'm nidhin

Reputation: 2662

Adding multiple users at a time in joomla

I have created a joomla component where we can upload the csv file which contain the user name and email of many users.I have written query for inserting the data to the jos_users table.The password in auto generated and i have encrypted the password using $crypt = JUserHelper::getCryptedPassword("blabla", $salt); I haven't inserted anything in the activation field. But due to some reasons I cannot login using the username and the password.Should I do any thing else for this ?

Upvotes: 1

Views: 910

Answers (2)

I'm nidhin
I'm nidhin

Reputation: 2662

Thanks Brent for your time.I have found the answer and is explained below.

For creating new user accounts by script you need to execute three queries. 1) insert into jos_users (id,name,username,email,password,usertype,block,sendEmail,gid,registerDate,lastvisitDate) values (NULL,'name','username','email','password','Registered','0','0','18','date','date2')

2) insert into jos_core_acl_aro (id,section_value,value,name) values (NULL, 'users', '(insertid of the above query)', 'name')

3) insert into jos_core_acl_groups_aro_map (group_id,section_value,aro_id) values (18, '', '(insertid of the above query)')

This worked for me.

Upvotes: 3

Brent Friar
Brent Friar

Reputation: 10609

In order for a user to be able to log in -

  1. activation field must be blank
  2. user must be enabled
  3. user must be a member of a group

Upvotes: 0

Related Questions