Ejemplo n.º 1
0
 /**
  * Create and return a Auth instance
  *
  * @param  ServiceLocatorInterface $serviceLocator
  * @return Auth
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $config = $serviceLocator->get('Configuration');
     $config = isset($config['ze-auth']) && (is_array($config['ze-auth']) || $config['ze-auth'] instanceof ArrayAccess) ? $config['ze-auth'] : array();
     $auth = new Auth();
     $auth->setServiceManager($serviceLocator);
     $auth->setConfig($config);
     return $auth;
 }
Ejemplo n.º 2
0
 /**
  * Return the logged user or null if not logged in
  * @return \ZeAuth\Db\MapperInterface
  */
 public function user()
 {
     return $this->service->getLoggedUser();
 }