/** * @param string $type [isp, operator] * @return Zend_Auth_Result */ public function authenticate($type = "isp") { if ($this->_type == "operator") { $result = AdminUser::checkMD5OperatorCredencialsByPassCode($this->_identity); } else { $result = AdminUser::checkMD5IspCredencialsByPassCode($this->_identity); } if (is_array($result)) { return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $result); } elseif ($result === false) { return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, null); } elseif (is_null($result)) { return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, null); } else { return new Zend_Auth_Result(Zend_Auth_Result::FAILURE, null); } }