Example #1
0
 /**
  * Open user session
  *
  * @param User $user
  *
  * @return Session
  *
  * @throws \Exception_InternalServerError
  */
 public function openAccount(User $user)
 {
     $this->session->remove('usr_id');
     $this->session->remove('session_id');
     $session = new Session();
     $session->setBrowserName($this->browser->getBrowser())->setBrowserVersion($this->browser->getVersion())->setPlatform($this->browser->getPlatform())->setUserAgent($this->browser->getUserAgent())->setUser($user);
     $this->em->persist($session);
     $this->em->flush();
     $this->populateSession($session);
     foreach ($this->app['acl']->get($user)->get_granted_sbas() as $databox) {
         \cache_databox::insertClient($this->app, $databox);
     }
     $this->reinitUser();
     return $session;
 }
 /**
  * {@inheritDoc}
  */
 public function setBrowserName($browserName)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setBrowserName', array($browserName));
     return parent::setBrowserName($browserName);
 }