Authenticating against phpass hashes with Yii

Comparing #6 with #8

Revision #8 was created by Da:Sourcerer Da:Sourcerer on Feb 22, 2012, 9:47:51 AM.

Fixed bug mentioned by fr0d0z

Content

[...]
public function beforeSave()
{
if(!empty($this->password1) && $this->password1==$this->password2)
{
$ph=new PasswordHash(Yii::app()->params['phpass']['iteration_count_log2'], Yii::app()->params['phpass']['portable_hashes']);
$this->password=$ph->HashPassword($this->password
1);
}
return parent::beforeSave();
[...]
-----

- [How to manage a PHP application's users and passwords](http://www.openwall.com/articles/PHP-Users-Passwords)

 
- [Wikipedia (en): bcrypt](http://en.wikipedia.org/wiki/Bcrypt "[Wikipedia (en)] bcrypt")
 
- [USENIX99](http://www.usenix.org/events/usenix99/provos.html "USENIX99: A Future-Adaptable Password Scheme") - Original bcrypt proposal