gaetgodi
Posts: 9
|
Posted: 11/07/2009, 1:01 PM |
|
I recently needed to create passwords for users created in Codecharge and added to Joomla.
I added the following line to the includes area of the code section of the page prompting for the password:
include_once(RelativePath . "/libraries/joomla/user" . "/helper.php");
then I used the following code to create the password (in the before insert event)
$salt = JUserHelper::genRandomPassword(32);
$crypt = JUserHelper::getCryptedPassword($password, $salt);
$pwd = $crypt.':'.$salt;
where,
{password} is the password that I wished to encrypt
I assume you know how to create the $password variable and how to set the subsequent $pwd variable.
|
|
|
|