Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function __construct(Container $container)
 {
     parent::__construct($container);
     $this->auth = $container->get('auth');
     $this->user = $this->auth->getUser();
     $this->acl = $container->get('acl');
 }
Beispiel #2
0
 protected function create(Container $c)
 {
     $auth = new Manager($c->get('session'), $c->get('auth-provider'), $c->get('config')->get('session.autologin', true) && $c->has('autologin-provider') ? $c->get('autologin-provider') : null);
     $request = $c->get('request');
     $c->get('controller')->addSendListener(function ($response) use($request, $auth) {
         $auth->visit($request);
     });
     if ($auth->usesAutologin()) {
         $auth->addLoadListener(function ($user) use($request, $auth) {
             if ($user->isGuest()) {
                 $auth->autologin($request);
             }
         });
     }
     return $auth;
 }