getMainUrl()); $this->ensureFormLoginAndRedirect($username, $password, $destPage); authz::manager()->checkSession($flcUsername, $flcAuthType); $this->flcUsername = $flcUsername; $this->flcAuthType = $flcAuthType; } function afterConfig(): void { $this->TLoginPage_afterConfig(); parent::afterConfig(); } private $flcUsername = null; private $flcAuthType = null; function print(): void { page::no_cache(); $username = P::get("u"); $password = P::get("p"); ly::row(); $this->printTitle(); ly::col(["sm" => 6, "sm-push" => 3]); $status = authz::get_status(); switch ($status) { case authz::DISCONNECTED: msg::warning("Vous avez été déconnecté. Veuillez vous reconnecter"); break; case authz::UNAUTHORIZED: msg::error(["user" => [ "Connecté en tant que ", v::b(authz::get_auth()), ", vous n'êtes pas autorisé à accéder à la page que vous avez demandé.", ]]); break; } ly::panel("Connexion par identifiant/mot de passe"); fo::start([ "type" => "basic", "action" => "", "method" => "post", ]); fo::text("Identifiant", "u", $username?: $this->flcUsername, [ "accesskey" => "q", "placeholder" => "Votre identifiant", ]); fo::password("Mot de passe", "p", $password, [ "placeholder" => "Votre mot de passe", ]); if ($username || $password) { msg::error("$username: Votre identifiant et/ou votre mot de passe sont incorrects"); } elseif ($username === "") { msg::error("Vous devez saisir votre identifiant"); } elseif ($password === "") { msg::error("Vous devez saisir votre mot de passe"); } fo::submit(["Connexion", "accesskey" => "r"]); if (authz::is_auth() && $this->flcAuthType === "form") { if ($status != authz::UNAUTHORIZED) { msg::warning(["user" => [ "Connecté en tant que ", v::b(authz::get_auth()), ", vous n'êtes pas autorisé à accéder à cette application.", ]]); } fo::submit([ "Vous déconnecter", "accesskey" => "z", "formmethod" => "get", "formaction" => $this->getLogoutUrl(), ]); } fo::end(); ly::end(); } }