How do I change user password

Notice: This thread is very old.
frocco
Member | 46
+
0
-

Hello,

I have the form completed, but need to know what steps to do in controller to apply user changes.

Thanks

Frank

frocco
Member | 46
+
0
-

This is working below.
Is this the best way to do this?

$user = $this->getUser();
$row = $this->database->table('users')->get($user->id);
$data['password'] = Passwords::hash($values['new_password']);
$row->update($data);
David Grudl
Nette Core | 8082
+
+1
-

Yes, it is the best way.

frocco
Member | 46
+
0
-

Thanks