本文整理汇总了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);
}
}