public function indexAction()
{
$user = $this->getUser();
if (!$user) {
\Pimcore::getEventManager()->trigger("admin.login.index.authenticate", $this, ["username" => $this->getParam("username"), "password" => $this->getParam("password")]);
$user = $this->getUser();
if ($user instanceof User && $user->getId() && $user->isActive() && $user->getPassword()) {
Tool\Session::useSession(function ($adminSession) use($user) {
$adminSession->user = $user;
});
}
}
if ($this->getUser() instanceof User) {
$this->redirect("/admin/?_dc=" . time());
}
if ($this->getParam("auth_failed")) {
$this->view->error = "error_auth_failed";
}
if ($this->getParam("session_expired")) {
$this->view->error = "error_session_expired";
}
}