MedicalTrainingTracker/src/main/webapp/vue/login.jsp

73 lines
2.4 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ page isELIgnored="false"%>
<!DOCTYPE html>
<html lang="en">
<head>
<%@ include file="base/header.jsp"%>
<spring:url value="/static/css/signin.css" var="signinCSS" />
<link href="${signinCSS}" rel="stylesheet">
</head>
<body>
<div class="container">
<spring:url value="/login" var="loginURL_POST" />
<form id="loginForm" class="form-signin" action="${loginURL_POST}" method="POST">
<h2 class="form-signin-heading">Authentification</h2>
<!--
<input type="text" id="inputLogin" name="inputLogin" class="form-control" placeholder="Login" required autofocus />
<input type="password" id="inputPassword" name="inputPassword" class="form-control" placeholder="Mot de passe" required />
-->
<input type="text" id="inputLogin" name="username" class="form-control" placeholder="Login" required autofocus />
<input type="password" id="inputPassword" name="password" class="form-control" placeholder="Mot de passe" required />
<button class="btn btn-lg btn-primary btn-block" type="submit">Valider</button>
<br/>
<p id="errorAuth" style="color: red;" hidden>Erreur lors de l'authentification</p>
<p id="errorBDD" style="color: red;" hidden></p>
</form>
</div>
<%@ include file="base/footer.jsp"%>
<spring:url value="/static/js/jquery.md5.js" var="md5JS" />
<script src="${md5JS}"></script>
<script type="text/javascript">
// TODO md5 password
var toto = "${isErrorAuth}";
if (toto != "") {
$('#errorAuth').removeAttr("hidden");
}
$("form").attr('action', window.location.pathname);
$("#loginForm").submit(function() {
//$('#inputPassword').val($.md5($('#inputPassword').val()));
console.log("Password: "+$('#inputPassword').val());
return true;
});
var redirectTo = "${REDIRECTION_URL}";
var isBddOk = ${IS_BDD_OK};
if (!isBddOk) {
$('#errorBDD').removeAttr("hidden");
$('#errorBDD').html("Erreur de connexion à la base de données.");
if (redirectTo != "") {
$('#errorBDD').html("<br/>Redirection vers : <a href=\""+redirectTo+"\" style=\"color: red; text-decoration: underline;\">"+redirectTo+"</a>");
setTimeout(function(){window.location.href = redirectTo;}, 5000);
}
}
</script>
</body>
</html>