This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

mnjkshrm27012
mnjkshrm27012

I have created a new plugin for creating a new user and in the model, I use the afterSave() method and with the help of Backend::register, i store the details, namely, firstname,lastname,password,login,usergroup. So when I create a new user for first time, the password gets stored in the backend_users table of october, where the password is hashed and other details are visible. However when I am trying to update the user, I have to enter the password and confirm_password again otherwise, I cant update the user. I want it to be in a manner such that, if the password is not entered it should take the old password which was already saved. Is there any other method of octobercms which allows to bypass this?

alezzzzz
alezzzzz

From this post : https://octobercms.com/forum/post/password-field-is-empty

"to avoid the password is updated every time you save the form, you can verify if the password field has a change before you update de model"

public function beforeUpdate(){
    if($this->attributes['password']=='') {
        unset($this->attributes['password']);
    }
}

Last updated

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.