public function read() { $identity = parent::read(); /* @var $config \SkelletonApplication\Options\ZfcUserModuleOptions */ $config = $this->getServiceManager()->get('zfcuser_module_options'); // If userState is enabled, check if user is allowed to log in if ($config->getEnableUserState() && !in_array($identity->getState(), $config->getAllowedLoginStates())) { $this->clear(); return $this->resolvedIdentity; } return $identity; }
/** * @covers ZfcUser\Authentication\Storage\Db::getStorage * @covers ZfcUser\Authentication\Storage\Db::setStorage */ public function testSetGetStorage() { $storage = new \Zend\Authentication\Storage\Session('ZfcUserStorage'); $this->db->setStorage($storage); $this->assertInstanceOf('Zend\\Authentication\\Storage\\Session', $this->db->getStorage()); }
/** * {@inheritDoc} */ public function write($contents) { parent::write($contents); $this->getEventManager()->trigger(__FUNCTION__ . '.post', $this, ['user' => $this->read()]); }