我正在将一个joomla用户数据库移动到一个新的自定义CMS,但我想包含salt的joomla帮助程序类。我如何在我自己的代码中从helper.php中运行include
?
答案 0 :(得分:0)
忘掉问题了。
我只是生成自己的randoms并遵循Joomla的登录协议
寄存器:
$salt = uniqid('', true);
$crypt = md5($password.$salt);
$password = $crypt.':'.$salt;
登录
if( $row !== false )
{
$parts = explode( ':', $row['password']);
// Check if password is md5-ed with or without salt
if (count($parts) < 2)
$new_password = md5($_GET["password"]);
else
{
// get some salt
$salt = $parts[1];
// convert the raw password to Joomla md5(password+salt):salt model
$new_password = md5($_GET["password"] . $salt) . ":" . $salt;
}
// authenticate
if ( $new_password != $row['password'] )
echo "NO"; // your params
else
echo "YES," . $row['name'] . "," . $row['email']; // your params
// clean up
mysql_free_result($result);
}