本文整理匯總了PHP中Zend_Auth_Adapter_DbTable::_authenticateValidateResult方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Auth_Adapter_DbTable::_authenticateValidateResult方法的具體用法?PHP Zend_Auth_Adapter_DbTable::_authenticateValidateResult怎麽用?PHP Zend_Auth_Adapter_DbTable::_authenticateValidateResult使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Auth_Adapter_DbTable
的用法示例。
在下文中一共展示了Zend_Auth_Adapter_DbTable::_authenticateValidateResult方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _authenticateValidateResult
/**
* Validate the identity returned from the database.
*
* Overrides the Zend implementation to provide user IDs, not usernames
* upon successful validation.
*
* @param array $resultIdentity
* @todo Should this instead override _authenticateCreateAuthResult()?
*/
protected function _authenticateValidateResult($resultIdentity)
{
$authResult = parent::_authenticateValidateResult($resultIdentity);
if (!$authResult->isValid()) {
return $authResult;
}
// This auth result uses the username as the identity, what we need
// instead is the user ID.
$correctResult = new Zend_Auth_Result($authResult->getCode(), $this->_resultRow['id'], $authResult->getMessages());
return $correctResult;
}
示例2: _authenticateValidateResult
protected function _authenticateValidateResult($resultIdentity)
{
if ($resultIdentity['domain_user']) {
$ldap = new Base_Ldap();
if (!$ldap->checkUserInLdap($this->_identity, $this->_credential)) {
$this->_authenticateResultInfo['code'] = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;
$this->_authenticateResultInfo['messages'][] = 'Supplied credential is invalid.';
return $this->_authenticateCreateAuthResult();
}
unset($resultIdentity[$zendAuthCredentialMatchColumn]);
$this->_resultRow = $resultIdentity;
$this->_authenticateResultInfo['code'] = Zend_Auth_Result::SUCCESS;
$this->_authenticateResultInfo['messages'][] = 'Authentication successful.';
return $this->_authenticateCreateAuthResult();
} else {
return parent::_authenticateValidateResult($resultIdentity);
}
}