Commit d98ec80c by Alexander Makarov

Used setter as field

parent e4c98f0f
......@@ -18,6 +18,7 @@ use yii\web\IdentityInterface;
* @property integer $status
* @property integer $created_at
* @property integer $updated_at
* @property string $password write-only password
*/
class User extends ActiveRecord implements IdentityInterface
{
......
......@@ -59,7 +59,7 @@ class ResetPasswordForm extends Model
{
$user = $this->_user;
if ($user->validate()) {
$user->setPassword($this->password);
$user->password = $this->password;
$user->removePasswordResetToken();
return $user->save();
} else {
......
......@@ -44,7 +44,7 @@ class SignupForm extends Model
$user = new User();
$user->username = $this->username;
$user->email = $this->email;
$user->setPassword($this->password);
$user->password = $this->password;
$user->generatePasswordResetToken();
$user->role = User::ROLE_USER;
$user->status = User::STATUS_ACTIVE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment