Commit d98ec80c by Alexander Makarov

Used setter as field

parent e4c98f0f
...@@ -18,6 +18,7 @@ use yii\web\IdentityInterface; ...@@ -18,6 +18,7 @@ use yii\web\IdentityInterface;
* @property integer $status * @property integer $status
* @property integer $created_at * @property integer $created_at
* @property integer $updated_at * @property integer $updated_at
* @property string $password write-only password
*/ */
class User extends ActiveRecord implements IdentityInterface class User extends ActiveRecord implements IdentityInterface
{ {
......
...@@ -59,7 +59,7 @@ class ResetPasswordForm extends Model ...@@ -59,7 +59,7 @@ class ResetPasswordForm extends Model
{ {
$user = $this->_user; $user = $this->_user;
if ($user->validate()) { if ($user->validate()) {
$user->setPassword($this->password); $user->password = $this->password;
$user->removePasswordResetToken(); $user->removePasswordResetToken();
return $user->save(); return $user->save();
} else { } else {
......
...@@ -44,7 +44,7 @@ class SignupForm extends Model ...@@ -44,7 +44,7 @@ class SignupForm extends Model
$user = new User(); $user = new User();
$user->username = $this->username; $user->username = $this->username;
$user->email = $this->email; $user->email = $this->email;
$user->setPassword($this->password); $user->password = $this->password;
$user->generatePasswordResetToken(); $user->generatePasswordResetToken();
$user->role = User::ROLE_USER; $user->role = User::ROLE_USER;
$user->status = User::STATUS_ACTIVE; $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