Home Gitesh Portfolio Blog About Me Gallery Contact

How to add a user via phpMyAdmin Joomla

How to add a user via phpMyAdmin Joomla
There was now an easy task: there is a list of users (login, password, name and e-mail), should be on this list to create a user Joomla. Given the fact that users were little, I decided to write a SQL-query to insert the user directly from phpMyAdmin.
Information about registered users of Joomla is stored in multiple tables:

  • jos_users
  • jos_core_acl_aro
  • jos_core_acl_groups_aro_map

The first table is the main and contains all the data about the user. Two other tables belong to the system access rights differentiation Joomla and contain information about a User to a particular group of users Joomla.
To add a user to Joomla to run the following query:

INSERT INTO jos_users( `Name`, `Username`, `Password`, `Email`, `Usertype`, `Gid` )
VALUES( "Ivan Ivanov", 'Ivanov', Md5('12345'), 'Ivanov@mail.ru', 'Registered', 18 );
 
INSERT INTO jos_core_acl_aro( `Section_value`, `Value` )
VALUES ( 'Users', LAST_INSERT_ID() );
 
INSERT INTO jos_core_acl_groups_aro_map( `Group_id`, `Aro_id` )
VALUES ( 18, LAST_INSERT_ID() );

After executing this query, the list appears to Joomla user Ivan Ivanov, ivanov with login and password is 12345. User will belong to a group of Registered, as if he were joined via a standard component of registered users Joomla.
In this example, the user is automatically assigned to a group of Registered (in the first place, this information is prescribed in the table jos_users, and secondly the value of 18 corresponds to this particular group of users). Here is the complete list of groups and their names (if needed to insert these values ??into the query instead of 18, ‘Registered’):

  • 18 – ‘Registered’
  • 19 – ‘Author’
  • 20 – ‘Editor’
  • 21 – ‘Publisher’
  • 23 – ‘Manager’
  • 24 – ‘Administrator’
  • 1925 – ‘Super Administrator’

That is so simple and unpretentious, you can add to Joomla from phpMyAdmin. This method can be used to quickly add a given set of users (well, let’s say you have 5 sites, and they need to quickly add 5 editors, with the same data for authorization).

Posted: 22/04/2013 9:05:41 p.m. by Gitesh Shah | with 0 comments