Welcome Guest, Not a member yet? Register   Sign In
Mythauth - update password form
#11

(This post was last modified: 06-21-2021, 07:11 AM by kilishan.)

Alternatively, you could do something a little simpler like:

Code:
$userModel = model('UserModel');
$user = user();
$user->password = $this->request->getPost('password');
$userModel->save($user);

This grabs the currently logged in user via the user() helper function and returns a User entity. The setPassword() method is called automatically by the Entity class when you assign the password to the user entity, so simply assigning it like that will automatically hash the password. Then the User entity is saved.
Reply


Messages In This Thread
Mythauth - update password form - by schwaluck - 03-21-2021, 08:02 AM
RE: Mythauth - update password form - by InsiteFX - 03-21-2021, 08:49 PM
RE: Mythauth - update password form - by InsiteFX - 03-22-2021, 10:43 AM
RE: Mythauth - update password form - by ikesela - 03-22-2021, 10:37 PM
RE: Mythauth - update password form - by fuzna28 - 03-31-2021, 08:49 AM
RE: Mythauth - update password form - by fuzna28 - 04-02-2021, 06:43 AM
RE: Mythauth - update password form - by kilishan - 06-21-2021, 07:09 AM
RE: Mythauth - update password form - by ikesela - 06-21-2021, 07:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB