Add registerSuccess.jsp

This commit is contained in:
Sofia Baltzi 2017-11-01 10:58:15 +00:00
parent 8289664c88
commit 3a5c87f914
4 changed files with 156 additions and 62 deletions

View File

@ -42,7 +42,7 @@ public class ActivationCodeServlet extends HttpServlet{
if (!verificationActions.verificationCodeHasExpired(formUsername)) {
HttpSession session = request.getSession();
session.setAttribute("username", formUsername);
response.sendRedirect("./addPassword.jsp");
response.sendRedirect("./registerSuccess.jsp");
} else {
logger.info("Verification code has expired!");
response.sendRedirect("./expiredVerificationCode.jsp");

View File

@ -51,20 +51,20 @@ public class RegisterServlet extends HttpServlet {
String username = request.getParameter("username");
String email =request.getParameter("email");
String confirmEmail = request.getParameter("email_conf");
//String password = request.getParameter("password");
//String confirmPassword = request.getParameter("password_conf");
String password = request.getParameter("password");
String confirmPassword = request.getParameter("password_conf");
if (organization == null){
logger.info("organization is null");
}
if (firstName != null && lastName != null && username != null &&
email.equals(confirmEmail) /*&& password.equals(confirmPassword)*/ ) {
email.equals(confirmEmail) && password.equals(confirmPassword) ) {
try {
if (username.matches("^[a-zA-Z0-9][a-zA-Z0-9_-]{4,150}") && !ldapActions.usernameExists(username) && !ldapActions.emailExists(email)) {
ldapActions.createUser(username, email, firstName, lastName, organization/*, password*/);
ldapActions.createUser(username, email, firstName, lastName, organization, password);
logger.info("User successfully created");
UUID verificationCode = UUID.randomUUID();

View File

@ -91,17 +91,17 @@
<div class="form-group">
<input id="email_conf" name="email_conf" type="text" placeholder="Confirm email (*)" class="form-control" value=${email_conf}></div>
<c:remove var="email_conf" scope="session" />
<%--<div class="form-group">--%>
<%--<span class="msg_password_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your password.</span>--%>
<%--<span class="msg_pass_conf_error uk-text-danger uk-text-small uk-float-left" style="display:none">These passwords don't match.</span>--%>
<%--<p><span class="msg_please_add uk-text-danger uk-text-small uk-float-left" style="display:none">Please add: &nbsp</span></p>--%>
<%--<span class="msg_lowercase_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A lowercase letter. &nbsp</span>--%>
<%--<span class="msg_capital_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A capital (uppercase) letter. &nbsp </span>--%>
<%--<span class="msg_number uk-text-danger uk-text-small uk-float-left" style="display:none">A number. &nbsp</span>--%>
<%--<span class="msg_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Minimum 6 characters. &nbsp</span>--%>
<%--<input id="password" name="password" type="password" placeholder="Password" class="form-control"></div>--%>
<%--<div class="form-group">--%>
<%--<input id="password_conf" name="password_conf" type="password" placeholder="Confirm password" class="form-control"></div>--%>
<div class="form-group">
<span class="msg_password_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your password.</span>
<span class="msg_pass_conf_error uk-text-danger uk-text-small uk-float-left" style="display:none">These passwords don't match.</span>
<p><span class="msg_please_add uk-text-danger uk-text-small uk-float-left" style="display:none">Please add: &nbsp</span></p>
<span class="msg_lowercase_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A lowercase letter. &nbsp</span>
<span class="msg_capital_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A capital (uppercase) letter. &nbsp </span>
<span class="msg_number uk-text-danger uk-text-small uk-float-left" style="display:none">A number. &nbsp</span>
<span class="msg_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Minimum 6 characters. &nbsp</span>
<input id="password" name="password" type="password" placeholder="Password" class="form-control"></div>
<div class="form-group">
<input id="password_conf" name="password_conf" type="password" placeholder="Confirm password" class="form-control"></div>
<div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
<div class="uk-width-1-1 uk-text-meta uk-text-danger uk-first-column">(*) Required fields</div>
<div class="uk-width-1-1 uk-grid-margin uk-first-column">RECAPTHA I AM NOT A ROBOT THING GOES HERE</div>
@ -114,55 +114,55 @@
<!-- END OF REGISTER FORM -->
<script>
//var myInput = document.getElementById("password");
var myInput = document.getElementById("password");
var usernameInput = document.getElementById("username");
//var myEmailInput = document.getElementById("email");
// // When the user starts to type something inside the password field
// myInput.onkeyup = function() {
//
// // Validate lowercase letters
// var lowerCaseLetters = /[a-z]/g;
// if (myInput.value.match(lowerCaseLetters)) {
// $(".msg_lowercase_letter").fadeOut();
// } else {
// $(".msg_lowercase_letter").fadeIn();
// }
//
// // Validate capital letters
// var upperCaseLetters = /[A-Z]/g;
// if (myInput.value.match(upperCaseLetters)) {
// $(".msg_capital_letter").fadeOut();
// } else {
// $(".msg_capital_letter").fadeIn();
// }
//
// // Validate numbers
// var numbers = /[0-9]/g;
// if (myInput.value.match(numbers)) {
// $(".msg_number").fadeOut();
// } else {
// $(".msg_number").fadeIn();
// }
//
// // Validate length
// if (myInput.value.length >= 6) {
// $(".msg_lenght").fadeOut();
// } else {
// $(".msg_lenght").fadeIn();
// }
//
// if(myInput.value.match(lowerCaseLetters) && myInput.value.match(upperCaseLetters)
// && myInput.value.match(numbers) && (myInput.value.length >= 6)){
// if($(".msg_please_add").css('display')!='none'){
// $(".msg_please_add").fadeOut();
// }
// } else {
// if($(".msg_please_add").css('display')=='none') {
// $(".msg_please_add").fadeIn();
// }
// }
// }
// When the user starts to type something inside the password field
myInput.onkeyup = function() {
// Validate lowercase letters
var lowerCaseLetters = /[a-z]/g;
if (myInput.value.match(lowerCaseLetters)) {
$(".msg_lowercase_letter").fadeOut();
} else {
$(".msg_lowercase_letter").fadeIn();
}
// Validate capital letters
var upperCaseLetters = /[A-Z]/g;
if (myInput.value.match(upperCaseLetters)) {
$(".msg_capital_letter").fadeOut();
} else {
$(".msg_capital_letter").fadeIn();
}
// Validate numbers
var numbers = /[0-9]/g;
if (myInput.value.match(numbers)) {
$(".msg_number").fadeOut();
} else {
$(".msg_number").fadeIn();
}
// Validate length
if (myInput.value.length >= 6) {
$(".msg_lenght").fadeOut();
} else {
$(".msg_lenght").fadeIn();
}
if(myInput.value.match(lowerCaseLetters) && myInput.value.match(upperCaseLetters)
&& myInput.value.match(numbers) && (myInput.value.length >= 6)){
if($(".msg_please_add").css('display')!='none'){
$(".msg_please_add").fadeOut();
}
} else {
if($(".msg_please_add").css('display')=='none') {
$(".msg_please_add").fadeIn();
}
}
}
usernameInput.onkeyup = function() {

View File

@ -0,0 +1,94 @@
<%--
Created by IntelliJ IDEA.
User: sofia
Date: 1/11/2017
Time: 12:44 μμ
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<META HTTP-EQUIV=Refresh CONTENT="0.5; URL=http://beta.services.openaire.eu/uoa-user-management/openid_connect_login">
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OpenAIRE - Forgot password</title>
<script src="./js/jquery.js"></script>
<script src="./js/uikit.js"></script>
<script src="./js/validation.js"></script>
<link rel="stylesheet" style="text/css" href="./css/theme.css">
<link rel="stylesheet" style="text/css" href="./css/custom.css">
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE -->
<!-- MAIN MENU STARTS HERE -->
<div class="tm-header tm-header-transparent" uk-header="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item">
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
</div>
</div>
</nav>
</div>
</div>
<!-- MENU ENDS HERE -->
<!-- CONTENT STARTS HERE -->
<div class="first_page_section uk-section-default uk-section uk-padding-remove-vertical">
<div class="first_page_banner_headline uk-grid-collapse uk-flex-middle uk-margin-remove-vertical uk-grid" uk-grid="">
</div>
</div>
<div class=" uk-section uk-margin-small-top tm-middle custom-main-content" id="tm-main">
<div class="uk-container uk-container-small uk-margin-medium-top uk-margin-small-bottom uk-text-center">
<%--<h2 class="uk-h2 uk-margin-small-bottom">Forgot Password</h2>--%>
<div uk-grid="" class="uk-grid uk-grid-stack">
<div class="tm-main uk-width-1-2@s uk-width-1-1@m uk-width-1-1@l uk-row-first uk-first-column uk-align-center">
<div class="uk-grid ">
<!-- CENTER SIDE -->
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
<!-- <h3 class="uk-h3">Create an account</h3> -->
<div class="middle-box text-center loginscreen animated fadeInDown ">
<h3 class="uk-h4 uk-text-success">You have successfully registered!</h3>
<div class="uk-width-1-3@m uk-align-center">
<%--<p>Please click <a href="http://beta.services.openaire.eu/uoa-user-management/openid_connect_login">here</a> to login.</p>--%>
</div>
</ul>
</div>
</div>
<!-- END OF CENTER SIDE -->
</div>
</div>
</div>
</div>
</div>
<!-- CONTENT ENDS HERE -->
<!-- FOOTER STARTS HERE-->
<div class="custom-footer" style="z-index: 200;">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
</a>
</div>
</div>
</div>
</div>
</div>
</div> <!-- FOOTER ENDS HERE -->
</div>
</body>
</html>