認証とログインのスクリプトを作成しようとしていますが、そこで静かです。データベースにパスワード「password」が保存されています...パスワード「password」で機能しますが、「password1!」では機能しません。または、2文字以上のプレフィックスまたはサフィックス....それを受け入れるべきではありません...しかし、別の文字列(別の文字列、またはさらに数文字)を入力すると、適切なエラーが発生します...
これが私のデータベーステーブルの唯一の行です...重複するエントリはありません。
以下はコードです
public function validate_login($valuethrown) {
$username = $valuethrown['username'];
$email = $valuethrown['email'];
$password = $valuethrown['password'];
echo "Values thrown to the model are : $username, $email, $password";
$authAdapter = $this->getAuthAdaptor();
$authAdapter->setIdentity($email)
->setCredential(md5($password));
$auth = Zend_Auth::getInstance();
$result = $auth->authenticate($authAdapter);
if ($result->isValid()) {
$data = $authAdapter->getResultRowObject(null,'password');
$auth->getStorage()->write($data);
$this->_redirect('home');
} else {
echo "</br>Wrong Password</br>";
}
//check login details
}
public function getAuthAdaptor() {
$authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter());
$authAdapter->setTableName('users')
->setIdentityColumn('email')
->setCredentialColumn('password');
return $authAdapter;
}
ヘルプ!!!!