I’m writing a function to enable the users to change their password.
public function change_password() {
if ($this->request->is('post')) {
debug($this->request->data);
$tmpUsr = $this->User->find('first', array('conditions'=>array('user_id'=>$this->Auth->user('user_id'))));
debug($tmpUsr);
$tmpUsr['User']['password'] = AuthComponent::password($this->request->data['Change']['Confirmation']);
if ($this->User->save($tmpUsr)) {
debug("saved new password: " . $tmpUsr['User']['password']); // * after this debug is fired, the hash looks ok *
}
else {
debug("password was not saved");
}
}
}
Problem:
The saved password looks hashed, but I tried it and it looks like the values saved arent the correct hash.
In the database the saved hashed string is not correct altough after debugging it where I commented it looks ok..
Any ideas where could be a problem?
Im using the login functionality from cake tutorial (2.0)
I found the answer and it is just silly:
My mistake, sorry to take your time..