這似乎是一個愚蠢的問題,但在這個代碼,我哪裏會插入條件'WHERE state=1'
添加條件Zend_Auth_Adapter_DbTable
public function loginByUsernameAndPassword($username, $password)
{
$this->_auth_adapter = new Zend_Auth_Adapter_DbTable($this->getAdapter());
$this->_auth_adapter->setTableName('zend_administration_user')
->setIdentityColumn('user_nm')
->setCredentialColumn('password')
->setCredentialTreatment('SHA1(CONCAT(?,salt))');
$this->_auth_adapter->setIdentity($username)
->setCredential($password);
$result = Zend_Auth::getInstance()->authenticate($this->_auth_adapter);
return $result->isValid();
}
在其中條件不爲我工作。我正在嘗試' - > setCredentialTreatment('verified =「Y」');'根據文檔,我們無法通過這樣的條件 - [doc link](http://framework.zend.com/apidoc/1.0/ Zend_Auth/Zend_Auth_Adapter/Zend_Auth_Adapter_DbTable.html) – emaillenin 2011-06-07 06:39:34
' - > setCredentialTreatment('?and verified =「Y」');'works – emaillenin 2011-06-07 18:17:19