This function takes a unencrypted string (your password) and converts it into a JoomlaEncryptedPassword which you can insert directly into the jos_users table.
I've torn my hair out on this one until some guy on the joomla forum pointed out that it really is not that difficult. Anyway enough chit-chat. Here's the function:
function createJoomlaEncryptedPassword($password){ require_once('libraries/joomla/user/helper.php'); $salt = JUserHelper::genRandomPassword(32); $crypt = JUserHelper::getCryptedPassword($password, $salt); $encpassword = $crypt.':'.$salt; return $encpassword; }
By PHPin24 @ 2009-10-19 01:52:49
|