为 Kohana 上的用户注册生成密码哈希值
我无法在我们的 Kohana 构建的网站应用程序上注册新用户或修改用户密码。我确实可以访问我们的数据库,并且可以在那里更改密码,但我需要一种方法来从系统接受的字符串生成密码哈希值。
如何使用 hash_password(passwordstring, FALSE)
显示应插入数据库的哈希值?
modules/auth/classes/kohana/auth.php 文件中是否有我应该查看的内容?
I can't register new users, or modify user passwords, on our Kohana built website app. I do have access to our database and can change passwords there but I need a way to generate password hashes from strings which will be accepted by the system.
How can I use hash_password(passwordstring, FALSE)
to display the hash I should insert into the DB?
Is there anything in the modules/auth/classes/kohana/auth.php file that I should be looking at?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
echo Auth::instance()->hash_password('新密码')
。您不需要传递$salt
值,因为它会自动生成。Use
echo Auth::instance()->hash_password('new password')
. You dont need pass$salt
value because it will be generated automatically.Kohana只是一个框架,它不是一个用户系统。您将需要提供 hash_password 函数的代码,因为它看起来像某种库。
Kohana is just a framework, its not a user system. You will need to provide the code for the hash_password function as this looks like a library of some sort.