简体   繁体   English

joomla 2.5:ajax登录,检查用户名和密码是否正确

[英]joomla 2.5: ajax login, check if username and password is correct

Im developing a AJAX login form for joomla 2.5 . 我正在为joomla 2.5开发一个AJAX登录表单。 It's all working fine, last thing I need to achieve is the password checking. 一切正常,我需要做的最后一件事就是密码检查。 The password is being received with this piece of code: 使用这段代码收到密码:

$password = $_POST['password'];

in the database the password looks like this 在数据库中,密码看起来像这样

0c7aca777a2fec9c962a0e3938b8cb0f:7Zv9CyiSiIzFYDS7RtqrzsxuenjmmOgi

and this is the query (dont mind the safety for now) 这是查询(不介意现在的安全)

$mysqli->query("SELECT username FROM q4jli_users WHERE username='$username' AND password='$password'"); 

the second part of the hashed password is a random salt, so I think this cannot be checked, maybe I should only check the first part of the hashed password. 哈希密码的第二部分是随机盐,所以我认为这是无法检查的,也许我应该只检查哈希密码的第一部分。

Any ideas? 有任何想法吗? Assistance is much appreciated 非常感谢帮助

Checkout the Joomla API Docs . 查看Joomla API文档 If you don't find what you need there, take a look at the default joomla authenticatin plugin at plugins\\authentication\\joomla\\joomla.php , some of the other authentication plugins that are installed with Joomla. 如果你找不到你需要的东西,请看一下plugins\\authentication\\joomla\\joomla.php中的默认joomla authenticatin插件,这是与Joomla一起安装的一些其他身份验证插件。

And finally, this question: Custom PHP function to verify correct password in Joomla , might assist as well. 最后,这个问题: 自定义PHP函数来验证Joomla中的正确密码 ,也可能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM