Пример #1
0
 public function __construct(UserServiceInterface $userService)
 {
     parent::__construct($userService);
     $this->user = $this->userService->getUserByUsername('admin');
     if (!$this->user) {
         throw new LogicException("You must have an 'admin' user to be able to use the Admin Auth");
     }
 }
Пример #2
0
 public function __construct(UserServiceInterface $userService)
 {
     parent::__construct($userService);
     if (isset($_SESSION['user_id']) && isset($_SESSION['auth_hash'])) {
         if ($this->validateAuthHash($_SESSION['user_id'], $_SESSION['auth_hash'])) {
             $this->user = $this->userService->getUserById($_SESSION['user_id']);
         }
     }
     $this->input = new Input($_REQUEST ?: array());
 }
Пример #3
0
 public function __construct(UserServiceInterface $userService = null)
 {
     parent::__construct($userService);
 }