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.

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

报告相同问题?

悬赏问题

  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?