sarvan75 / yii-user-management

Automatically exported from code.google.com/p/yii-user-management
0 stars 0 forks source link

Password is double encrypted causing users to be unable to login. #113

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a new user
2. Login as admin
3. Change the password the previously created user

What is the expected output? What do you see instead?

Expected output is the encrypted password in the database.
Instead, the password is encrypted twice and so the user cannot login.

What version of the product are you using? On what operating system?

Please provide any additional information below.

In the file YumUser.php, the action beforeSave() encrypts the password only if 
the password_changed variable is set.  By setting this variable to NULL, only 
one encryption takes place instead of two.

Working code is: 

    public function beforeSave() {
        if ($this->password_changed) {
            $this->password = YumUser::encrypt($this->password);
            $this->password_changed = NULL;
        }
        return parent::beforeSave();
    }

Original issue reported on code.google.com by N.Brandi...@gmail.com on 12 Feb 2011 at 7:25

GoogleCodeExporter commented 9 years ago
i still can not reproduce this problem. i think it is fixed. if not, please 
reopen.

Original comment by thyseus on 16 Mar 2011 at 8:25