Reputation: 2662
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
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
Reputation: 10609
In order for a user to be able to log in -
Upvotes: 0