データベースにない場合に new_password フィールドと confirm_password フィールドを一致させる方法は?
こんにちは...フィールド「new_password」と「confirm_password」を一致させる方法を知りたいです。これらはデータベースに保存されず、パスワード変更モジュールで一致する目的で使用されます。
私はこれを試しましたが、うまくいきませんでした:
if($this->data['User']['new_password'] != $this->data['User']['confirm_password'] ) {
$this->Session->setFlash("New password and Confirm password field do not match");
} else {
$this->data['User']['password'] = $this->data['User']['new_password'];
$this->data['User']['id'] = $this->User->id;
if($this->User->save($this->data)) {
$this->Session->setFlash("Password updated");
$this->redirect('/users/login');
}
}