Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 /**
  * @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());
 }
Ejemplo n.º 3
0
 /**
  * {@inheritDoc}
  */
 public function write($contents)
 {
     parent::write($contents);
     $this->getEventManager()->trigger(__FUNCTION__ . '.post', $this, ['user' => $this->read()]);
 }