私は入力 'pass'と 'pass'をデータベースから比較しようとしています。一致する場合、ユーザーは登録フォームに進みます。同じパスワードの値を比較するとfalse cakephp
両方のパスワードが同じ値であっても、「パスワードが正しくありません」という偽の結果が表示され、通知が表示されます。 私は、CakePHP 2.8を
使用していますこれは私が今持っているコードです:
public function checkCodeRespondent() {
$password = $this->data['Respondent']['pass'];
if (isset($password) && !empty($password))
{
$respondent = $this->findByPass($password);
debug($respondent);
if ($this->data['Respondent']['pass'] != $respondent['pass']) {
print 'password is not correct';
} else {
print 'password is correct';
}
}
そして、これはデータベース
public function findByPass($pass) {
$respondent = $this->Respondent->find('first', array('conditions' => array('pass' => $pass)));
return $respondent;
}
いずれもハッシュ化されていません。 – user2314339