douningqiu4991 2012-08-02 19:16 采纳率: 0%
浏览 57
已采纳

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

Im developing a AJAX login form for joomla 2.5. 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

  • 写回答

1条回答 默认 最新

  • douhuanglou1445 2012-08-02 19:28
    关注

    Checkout the Joomla API Docs. 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.

    And finally, this question: Custom PHP function to verify correct password in Joomla, might assist as well.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?