-
-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: migrated login to controller (#3257)
- Loading branch information
Showing
8 changed files
with
190 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,97 @@ | ||
{% if isSecure %} | ||
<div id="pmf-admin-login"> | ||
<div id="pmf-admin-login-content"> | ||
<main> | ||
<div class="container"> | ||
<div class="row justify-content-center"> | ||
<div class="col-lg-6"> | ||
<div class="card shadow-lg border-1 rounded-lg mt-5"> | ||
<div class="card-header"> | ||
<h3 class="text-center font-weight-light my-4">phpMyFAQ Login</h3> | ||
{% extends '@admin/index.twig' %} | ||
|
||
{% if isError %} | ||
<div class="alert alert-danger alert-dismissible fade show" role="alert"> | ||
{{ errorMessage }} | ||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> | ||
</div> | ||
{% else %} | ||
<p> | ||
{{ loginMessage }} | ||
</p> | ||
{% endif %} | ||
{% block content %} | ||
|
||
{% if isLogout %} | ||
<div class="alert alert-success alert-dismissible fade show" role="alert"> | ||
{{ logoutMessage }} | ||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> | ||
{% endif %} | ||
</div> | ||
<div class="card-body"> | ||
<form action="{{ loginUrl }}" method="post" accept-charset="utf-8" role="form"> | ||
<input type="hidden" name="redirect-action" value="{{ redirectAction }}"> | ||
<div class="form-floating mb-3"> | ||
<input class="form-control" id="faqusername" name="faqusername" type="text" | ||
placeholder="{{ msgUsername }}"> | ||
<label for="faqusername">{{ msgUsername }}</label> | ||
{% if isSecure %} | ||
<div id="pmf-admin-login"> | ||
<div id="pmf-admin-login-content"> | ||
<main> | ||
<div class="container"> | ||
<div class="row justify-content-center"> | ||
<div class="col-lg-6"> | ||
<div class="card shadow-lg border-1 rounded-lg mt-5"> | ||
<div class="card-header"> | ||
<h3 class="text-center font-weight-light my-4">phpMyFAQ Login</h3> | ||
|
||
{% if isError %} | ||
<div class="alert alert-danger alert-dismissible fade show" role="alert"> | ||
{{ errorMessage }} | ||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> | ||
</div> | ||
<div class="input-group mb-3"> | ||
<div class="form-floating"> | ||
<input class="form-control" id="faqpassword" name="faqpassword" type="password" | ||
autocomplete="off" | ||
placeholder="{{ msgPassword }}" data-pmf-toggle="faqpassword_toggle"> | ||
<label for="faqpassword">{{ msgPassword }}</label> | ||
{% else %} | ||
<p> | ||
{{ loginMessage }} | ||
</p> | ||
{% endif %} | ||
|
||
{% if isLogout %} | ||
<div class="alert alert-success alert-dismissible fade show" role="alert"> | ||
{{ logoutMessage }} | ||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> | ||
{% endif %} | ||
</div> | ||
<div class="card-body"> | ||
<form action="{{ loginUrl }}" method="post" accept-charset="utf-8" role="form"> | ||
<input type="hidden" name="redirect-action" value="{{ redirectAction }}"> | ||
<div class="form-floating mb-3"> | ||
<input class="form-control" id="faqusername" name="faqusername" type="text" | ||
placeholder="{{ msgUsername }}"> | ||
<label for="faqusername">{{ msgUsername }}</label> | ||
</div> | ||
<span class="input-group-text" id="faqpassword_toggle"> | ||
<div class="input-group mb-3"> | ||
<div class="form-floating"> | ||
<input class="form-control" id="faqpassword" name="faqpassword" type="password" | ||
autocomplete="off" | ||
placeholder="{{ msgPassword }}" data-pmf-toggle="faqpassword_toggle"> | ||
<label for="faqpassword">{{ msgPassword }}</label> | ||
</div> | ||
<span class="input-group-text" id="faqpassword_toggle"> | ||
<i class="bi bi-eye-slash" id="faqpassword_toggle_icon"></i> | ||
</span> | ||
</div> | ||
<div class="form-check mb-3"> | ||
<input class="form-check-input" id="faqrememberme" name="faqrememberme" type="checkbox" | ||
value="rememberMe"> | ||
<label class="form-check-label" for="faqrememberme">{{ msgRememberMe }}</label> | ||
</div> | ||
<div class="d-flex align-items-center justify-content-between mt-4 mb-0"> | ||
<a class="small" href="../?action=password">{{ msgLostPassword }}</a> | ||
<button type="submit" class="btn btn-primary"> | ||
{{ msgLoginUser }} | ||
</button> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="card-footer text-center py-3"> | ||
{% if hasRegistrationEnabled %} | ||
<a class="w-100 py-2 mb-2 btn btn-outline-secondary rounded-3" href="../user/register"> | ||
{{ msgRegistration }} | ||
</a> | ||
{% endif %} | ||
{% if hasSignInWithMicrosoftActive %} | ||
<a class="w-100 py-2 mb-2 btn btn-outline-warning rounded-3" href="../services/azure"> | ||
<i class="bi bi-windows" aria-hidden="true"></i> | ||
{{ msgSignInWithMicrosoft }} | ||
</a> | ||
{% if isWebAuthnEnabled %} | ||
<a class="w-100 py-2 mb-2 btn btn-outline-primary rounded-3" href="../services/webauthn"> | ||
<i class="bi bi-key" aria-hidden="true"></i> | ||
{{ 'msgSignInWithPasskey' | translate }} | ||
</div> | ||
<div class="form-check mb-3"> | ||
<input class="form-check-input" id="faqrememberme" name="faqrememberme" type="checkbox" | ||
value="rememberMe"> | ||
<label class="form-check-label" for="faqrememberme">{{ msgRememberMe }}</label> | ||
</div> | ||
<div class="d-flex align-items-center justify-content-between mt-4 mb-0"> | ||
<a class="small" href="../?action=password">{{ msgLostPassword }}</a> | ||
<button type="submit" class="btn btn-primary"> | ||
{{ msgLoginUser }} | ||
</button> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="card-footer text-center py-3"> | ||
{% if hasRegistrationEnabled %} | ||
<a class="w-100 py-2 mb-2 btn btn-outline-secondary rounded-3" href="../user/register"> | ||
{{ msgRegistration }} | ||
</a> | ||
{% endif %} | ||
{% endif %} | ||
{% if hasSignInWithMicrosoftActive %} | ||
<a class="w-100 py-2 mb-2 btn btn-outline-warning rounded-3" href="../services/azure"> | ||
<i class="bi bi-windows" aria-hidden="true"></i> | ||
{{ msgSignInWithMicrosoft }} | ||
</a> | ||
{% if isWebAuthnEnabled %} | ||
<a class="w-100 py-2 mb-2 btn btn-outline-primary rounded-3" href="../services/webauthn"> | ||
<i class="bi bi-key" aria-hidden="true"></i> | ||
{{ 'msgSignInWithPasskey' | translate }} | ||
</a> | ||
{% endif %} | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</main> | ||
</main> | ||
</div> | ||
</div> | ||
</div> | ||
{% else %} | ||
<div class="alert alert-danger" role="alert"> | ||
<a href="{{ secureUrl }}">{{ msgNotSecure }}</a> | ||
|
||
</div> | ||
{% endif %} | ||
{% else %} | ||
<div class="alert alert-danger" role="alert"> | ||
<a href="{{ secureUrl }}">{{ msgNotSecure }}</a> | ||
</div> | ||
{% endif %} | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.