Password MD5 hash incorrect??? - Joomla! Forum - community, help and support
hello,
recently set our new homepage joomla , far everything's fine.
but have issue add new users database.
it not possible register on our website have insert new users ourself.
i wrote php-scripts add users, in our local database.
i know how calculate password hash since updated v2.5.7, not possible login new user, dispite of fact, user activated , in valid user-group.
that's how calculate hash:
it doesn't matter ether extract data post or get-mothod. i'am not able login passords.
what can do?
all want add new users , give them specified password...
thanks
recently set our new homepage joomla , far everything's fine.
but have issue add new users database.
it not possible register on our website have insert new users ourself.
i wrote php-scripts add users, in our local database.
i know how calculate password hash since updated v2.5.7, not possible login new user, dispite of fact, user activated , in valid user-group.
that's how calculate hash:
code: select all
function randomsalt($length)
{
$signs = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9");
$result;
$pos = 0;
while($pos < $length)
{
$result = $result . $signs[array_rand($signs, 1)];
$pos = $pos + 1;
}
return $result;
}
function cryptpassword($password)
{
$salt = randomsalt(32);
return md5($password . $salt) . ":" . $salt;
}it doesn't matter ether extract data post or get-mothod. i'am not able login passords.
what can do?
all want add new users , give them specified password...
thanks
i propose following method store password in joomla! 2.5
code: select all
jimport('joomla.user.helper');
$salt = juserhelper::genrandompassword(32);
$crypt = juserhelper::getcryptedpassword($raw_password, $salt);
$password_to_store = $crypt.':'.$salt;
Comments
Post a Comment