public function authenticate(Zend_Auth_Adapter_Interface $adapter) { $result = $adapter->authenticate(); if ($result->isValid()) { $this->_identity = $adapter->getResultRowObject(null, 'password'); $storage = $this->getStorage(); $zadmin_auth = $storage->create(); $storage->write($this->_identity); Zing_Cookies::createCookies(self::COOKIE_ADMIN_AUTH_KEY, $zadmin_auth, 0); } return $result; }
public function authenticate($username, $password) { $modelUser = new AdminReportHandler(); $result = $modelUser->getCreditsAdmin($username, md5($password)); if (count($result) == 1) { $result = $result[0]; //Identity from DB is object $this->_identity = new stdClass(); $this->_identity->userid = $result['adminID']; $this->_identity->username = $result['adminID']; $this->_identity->name = $result['adminName']; $storage = $this->getStorage(); $zadmin_auth = $storage->create(); $storage->write($this->_identity); Zing_Cookies::createCookies(self::COOKIE_ADMIN_AUTH_KEY, $zadmin_auth, 0); return true; } return false; }
public function authenticate($username, $password) { $modelUser = new Models_XMLUser(); $result = $modelUser->authenticate($username, $password); if ($result->valid) { //Identity from DB is object $this->_identity = new stdClass(); $this->_identity->userid = $result->user_info->userid; $this->_identity->username = $result->user_info->username; $this->_identity->userrole = $result->user_info->userrole; $this->_identity->controlblock = $result->user_info->controlblock; $this->_identity->name = $result->user_info->name; $storage = $this->getStorage(); $zadmin_auth = $storage->create(); $storage->write($this->_identity); Zing_Cookies::createCookies(self::COOKIE_ADMIN_AUTH_KEY, $zadmin_auth, 0); Zing_Cookies::createCookies(self::COOKIE_ADMIN_AUTH_ROLE, $result->user_info->userrole, 0); Zing_Cookies::createCookies(self::COOKIE_ADMIN_AUTH_SIG_KEY, md5($zadmin_auth . $result->user_info->userrole . ADMIN_AUTOREPORT_KEY), 0); } return $result->valid; }