/** * Главная страница панели управления */ public function indexAction() { $entities = $this->entityManager->getAll(); $users = AdminUsers::find(); $this->view->pick('CRUD/index'); $this->view->setVars(['entities' => $entities, 'users' => $users]); }
/** * @param string $username * @param string $password * * @return bool */ public function login($username, $password) { /** @var AdminUsers $user */ $user = AdminUsers::findFirstByUsername($username); if (!$user || !$user->active || !$this->security->checkHash($password, $user->password)) { return false; } $this->_session->set($this->_config['session_key'], $user->id); return true; }