使用 php 创建 joomla 用户密码?

2022-01-06 00:00:00 md5 passwords php password-hash joomla

我正在尝试为 Joomla 创建自定义注册组件,我想知道是否有人知道如何为 joomla 创建正确的密码加密?Joomla 密码如下所示:

I'm trying to create a custom registration component for Joomla, and I was wondering if anyone knew how to create the correct password encryption for joomla? Joomla passwords look like this :

fbae378704687625a410223a61c66eb1:VM6DwmVWHTwpquDq51ZXjWWADCIc93MR

fbae378704687625a410223a61c66eb1:VM6DwmVWHTwpquDq51ZXjWWADCIc93MR

我认为哪个是 md5(或其他)和一种加密方式?我只是在寻找各种 php 代码来创建相同的加密.

Which I believe are md5 (or something) and one way encryption? Am just looking for a php code of sorts to create that same encryption.

干杯

推荐答案

$salt = JUserHelper::genRandomPassword(32);
$crypt = JUserHelper::getCryptedPassword("yourpassword", $salt);
$password = $crypt.':'.$salt;

经过更多的搜索,我找到了答案,感谢大家的帮助:)

After a bit more searching i found my answer, thanks guys for your help :)

我忘了提到你需要在调用 JUserHelper 之前包含这一行:

I forgot to mention that you need to include this line before calling JUserHelper:

jimport('joomla.user.helper');

jimport('joomla.user.helper');

相关文章