PasswordHash不能使用CodeIgniter [英] PasswordHash not working with CodeIgniter

查看:114
本文介绍了PasswordHash不能使用CodeIgniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将我下载的文件从 http://www.openwall.com/phpass/应用程序/库

I have put the files I downloaded from http://www.openwall.com/phpass/ to application/libraries

在我的控制器中,我使用这个代码 -

In my controller, I am using this code -

$params = array(
       'phpass_hash_strength' => 8,
           'phpass_hash_portable' => FALSE
       );
$this->load->library('PasswordHash', $params);
$password = $this->passwordhash->HashPassword($pwd);

我得到这些错误 -

I am getting these errors -

A PHP Error was encountered

Severity: Notice

Message: Uninitialized string offset: 3

Filename: libraries/PasswordHash.php

Line Number: 116







A PHP Error was encountered

Severity: Warning

Message: strpos() [function.strpos]: Empty delimiter

Filename: libraries/PasswordHash.php

Line Number: 116



更新



已删除 PasswordHash.php ,使用 SimpleLoginSecure 现在。

Update

Removed PasswordHash.php, using SimpleLoginSecure now.

推荐答案

我认为你的问题是你试图使用一个通用的PHP对象作为CodeIgniter库。你不能只是这样做。您需要修改原始代码才能正常工作,或者下载提供的库已经为CodeIgniter设计的库

I think your problem is you are trying to use a generic PHP object as a CodeIgniter library. You can't just do that. You'll need to modify the original code to work, or download one of the contributed libraries already designed for CodeIgniter.

CodeIgniter库有一些限制(例如它们被实例化),所以只要将任何文件放入libraries文件夹,工作。

CodeIgniter libraries have some restrictions (such as how they are instantiated), so just dropping any file into the libraries folder won't work.

这篇关于PasswordHash不能使用CodeIgniter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆