I'm handling two websites a main one with a huge database and a secondary one, I want that when a user is created in the main one that it also creates it for the secondary one, I already connected the two databases and know how to handle all that, the issue is that Joomla requires the password of each user to be encrypted using the secret key in the configuration.php file. I know the plain password of each user, how would I go in order to encrypt them with php?

Something like

$password = '12345';
$secret_key = 'FoOb4r';
$new_password = encrypt($password, $secret_key);
// code to update 'password' in table_users to database with $new_password

Also, I'm messing around just with '_users' table, I suppose I should update '_user_usergroup_map' as well. Is there another table I should take a look at?

  • 2
    Direct database insertion is generally a bad approach - better to send the info across as json to a locked down endpoint. Then use something like the following: joomla.stackexchange.com/questions/21256/… – jamesgarrett Feb 3 at 22:44
  • Welcome to JSE @Max, please take our tour to earn your first badge and learn about how our community is unique. – mickmackusa Feb 3 at 23:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.