Add RequestToDelete page
This commit is contained in:
parent
42d43e6a85
commit
272bbde6fb
|
@ -0,0 +1,167 @@
|
|||
package eu.dnetlib.openaire.usermanagement;
|
||||
|
||||
import eu.dnetlib.openaire.user.utils.EmailSender;
|
||||
import eu.dnetlib.openaire.user.utils.LDAPActions;
|
||||
import eu.dnetlib.openaire.user.utils.VerificationActions;
|
||||
import eu.dnetlib.openaire.user.utils.VerifyRecaptcha;
|
||||
import eu.dnetlib.openaire.usermanagement.utils.UrlConstructor;
|
||||
import org.apache.commons.validator.routines.EmailValidator;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.IOException;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Created by sofia on 21/5/2018.
|
||||
*/
|
||||
public class RequestToDeleteAccountServlet extends HttpServlet {
|
||||
|
||||
@Autowired
|
||||
private VerificationActions verificationActions;
|
||||
|
||||
@Autowired
|
||||
private LDAPActions ldapActions;
|
||||
|
||||
@Autowired
|
||||
private EmailSender emailSender;
|
||||
|
||||
@Value("${oidc.home}")
|
||||
private String oidcHomeUrl;
|
||||
|
||||
@Value("${google.recaptcha.secret}")
|
||||
private String secret;
|
||||
|
||||
@Value("${google.recaptcha.key}")
|
||||
private String sitekey;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(RequestActivationCodeServlet.class);
|
||||
|
||||
public void init(ServletConfig config) throws ServletException {
|
||||
super.init(config);
|
||||
SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this,
|
||||
config.getServletContext());
|
||||
config.getServletContext().setAttribute("sitekey", sitekey);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
String formEmail = request.getParameter("email").trim();
|
||||
|
||||
String gRecaptchaResponse = request.getParameter("g-recaptcha-response");
|
||||
|
||||
HttpSession session = request.getSession();
|
||||
session.setAttribute("homeUrl", oidcHomeUrl);
|
||||
|
||||
if (formEmail == null) {
|
||||
request.getSession().setAttribute("message", "Error reading email.");
|
||||
response.sendRedirect("./requestToDeleteAccount.jsp");
|
||||
|
||||
} else if (formEmail.isEmpty()) {
|
||||
request.getSession().setAttribute("message", "Please enter your email.");
|
||||
response.sendRedirect("./requestToDeleteAccount.jsp");
|
||||
|
||||
} else if (!EmailValidator.getInstance().isValid(formEmail)) {
|
||||
request.getSession().setAttribute("message", "Please enter a valid email.");
|
||||
response.sendRedirect("./requestToDeleteAccount.jsp");
|
||||
|
||||
} else if (!VerifyRecaptcha.verify(gRecaptchaResponse, secret)) {
|
||||
request.getSession().setAttribute("reCAPTCHA_message", "You missed the reCAPTCHA validation!");
|
||||
response.sendRedirect("./requestToDeleteAccount.jsp");
|
||||
|
||||
} else {
|
||||
|
||||
try {
|
||||
|
||||
Boolean isRegistered = false;
|
||||
Boolean isZombie = false;
|
||||
|
||||
if (ldapActions.emailExists(formEmail)) {
|
||||
logger.info("User with email: " + formEmail + " is activated user!");
|
||||
isRegistered = true;
|
||||
} else if (ldapActions.isZombieUsersEmail(formEmail)) {
|
||||
logger.info("User with email: " + formEmail + " is zombie user!");
|
||||
isZombie = true;
|
||||
}
|
||||
|
||||
if (!isRegistered && !isZombie) {
|
||||
request.getSession().setAttribute("message", "There is no user with that email.");
|
||||
response.sendRedirect("./requestToDeleteAccount.jsp");
|
||||
} else {
|
||||
|
||||
String username = null;
|
||||
|
||||
if (isRegistered) {
|
||||
username = ldapActions.getUsername(formEmail);
|
||||
} else if (isZombie) {
|
||||
username = ldapActions.getZombieUsersUserName(formEmail);
|
||||
}
|
||||
|
||||
UUID verificationCode = UUID.randomUUID();
|
||||
Date creationDate = new Date();
|
||||
String vCode = verificationCode.toString();
|
||||
|
||||
Timestamp timestamp = new Timestamp(creationDate.getTime());
|
||||
|
||||
if (!verificationActions.verificationEntryExists(username)) {
|
||||
verificationActions.addVerificationEntry(username, vCode, timestamp);
|
||||
|
||||
} else {
|
||||
verificationActions.updateVerificationEntry(username, vCode, timestamp);
|
||||
}
|
||||
|
||||
String resultPath = UrlConstructor.getRedirectUrl(request, "verifyToDelete.jsp");
|
||||
String resultPathWithVCode = UrlConstructor.getVerificationLink(resultPath, vCode);
|
||||
|
||||
String verificationCodeMsg = "<p>Hello " + username + ",</p>" +
|
||||
"<p> A request has been made to get a verification code to delete your OpenAIRE account. To delete your " +
|
||||
"account, you will need to submit your username and this verification code in order to verify that the " +
|
||||
"request was legitimate.</p>" +
|
||||
"<p>" +
|
||||
"The verification code is " + vCode +
|
||||
"</p>" +
|
||||
"Click the URL below and proceed with deleting your account." +
|
||||
"<p><a href=" + resultPathWithVCode + ">" + resultPathWithVCode + "</a></p>" +
|
||||
"<p>The verification code is valid for 24 hours.</p>" +
|
||||
"<p>Thank you,</p>" +
|
||||
"<p>OpenAIRE technical team</p>";
|
||||
|
||||
String verificationCodeSubject = "Request to delete your OpenAIRE account";
|
||||
|
||||
emailSender.sendEmail(formEmail, verificationCodeSubject, verificationCodeMsg);
|
||||
logger.info("Sending verification code to user: " + formEmail);
|
||||
|
||||
|
||||
response.sendRedirect("./verifyToDelete.jsp");
|
||||
}
|
||||
} catch (MessagingException e) {
|
||||
logger.error("Error in sending email", e);
|
||||
request.getSession().setAttribute("message", "Error sending email");
|
||||
response.sendRedirect("./requestActivationCode.jsp");
|
||||
} catch (Exception ldape) {
|
||||
logger.error("Could not user with email " + formEmail, ldape);
|
||||
response.sendRedirect(UrlConstructor.getRedirectUrl(request, "error.jsp"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getOidcHomeUrl() {
|
||||
return oidcHomeUrl;
|
||||
}
|
||||
|
||||
public void setOidcHomeUrl(String oidcHomeUrl) {
|
||||
this.oidcHomeUrl = oidcHomeUrl;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
package eu.dnetlib.openaire.usermanagement;
|
||||
|
||||
import eu.dnetlib.openaire.user.utils.InputValidator;
|
||||
import eu.dnetlib.openaire.user.utils.LDAPActions;
|
||||
import eu.dnetlib.openaire.user.utils.VerificationActions;
|
||||
import eu.dnetlib.openaire.usermanagement.utils.UrlConstructor;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
* Created by sofia on 21/5/2018.
|
||||
*/
|
||||
public class VerifyToDeleteServlet extends HttpServlet {
|
||||
|
||||
public void init(ServletConfig config) throws ServletException {
|
||||
super.init(config);
|
||||
SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this,
|
||||
config.getServletContext());
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private VerificationActions verificationActions;
|
||||
|
||||
@Autowired
|
||||
private LDAPActions ldapActions;
|
||||
|
||||
private Logger logger = Logger.getLogger(VerificationCodeServlet.class);
|
||||
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
response.setContentType("text/html");
|
||||
PrintWriter printWriter = response.getWriter();
|
||||
|
||||
String formUsername = request.getParameter("username").trim();
|
||||
String formVerificationCode = request.getParameter("verification_code").trim();
|
||||
|
||||
try {
|
||||
if (InputValidator.isFilled(formUsername) && InputValidator.isFilled(formVerificationCode)) {
|
||||
if (verificationActions.verificationEntryExists(formUsername) && verificationActions.verificationCodeIsCorrect(formUsername, formVerificationCode)) {
|
||||
if (!verificationActions.verificationCodeHasExpired(formUsername)) {
|
||||
|
||||
Boolean isRegistered = false;
|
||||
Boolean isZombie = false;
|
||||
|
||||
if (ldapActions.usernameExists(formUsername)) {
|
||||
logger.info("User " + formUsername + " is activated user!");
|
||||
isRegistered = true;
|
||||
} else if (ldapActions.isZombieUsersUsername(formUsername)) {
|
||||
logger.info("User " + formUsername + " is zombie user!");
|
||||
isZombie = true;
|
||||
}
|
||||
|
||||
if (!isRegistered && !isZombie) {
|
||||
request.getSession().setAttribute("message", "Username or verification code are not valid.");
|
||||
response.sendRedirect("./verifyToDelete.jsp");
|
||||
} else {
|
||||
if (isRegistered) {
|
||||
ldapActions.deleteUser(formUsername);
|
||||
} else if (isZombie) {
|
||||
ldapActions.deleteZombieUser(formUsername);
|
||||
}
|
||||
response.sendRedirect(UrlConstructor.getRedirectUrl(request,"successDeleteAccount.jsp"));
|
||||
|
||||
}
|
||||
} else {
|
||||
logger.info("Verification code has expired!");
|
||||
response.sendRedirect(UrlConstructor.getRedirectUrl(request, "expiredVerificationCode.jsp"));
|
||||
}
|
||||
} else {
|
||||
logger.info("Username or verification code are not valid!");
|
||||
request.getSession().setAttribute("message", "Username or verification code are not valid.");
|
||||
response.sendRedirect("./verifyToDelete.jsp");
|
||||
}
|
||||
} else {
|
||||
if (!InputValidator.isFilled(formUsername)) {
|
||||
logger.info("No username");
|
||||
request.getSession().setAttribute("msg_username_error", "Please enter your username.");
|
||||
}
|
||||
if (!InputValidator.isFilled(formVerificationCode)) {
|
||||
logger.info("No verification code");
|
||||
request.getSession().setAttribute("msg_verification_code_error", "Please enter your verification code.");
|
||||
}
|
||||
response.sendRedirect("./verifyToDelete.jsp");
|
||||
}
|
||||
} catch (Exception ldape) {
|
||||
logger.error("Could not remove user with username " + formUsername, ldape);
|
||||
response.sendRedirect(UrlConstructor.getRedirectUrl(request, "error.jsp"));
|
||||
}
|
||||
|
||||
printWriter.close();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: sofia
|
||||
Date: 21/5/2018
|
||||
Time: 1:21 μμ
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<html>
|
||||
<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">
|
||||
<base href=".">
|
||||
<script src="./js/jquery.js"></script>
|
||||
<script src="./js/uikit.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">
|
||||
<script src='https://www.google.com/recaptcha/api.js'></script>
|
||||
<title>OpenAIRE - Request to Delete Account</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<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="{"align":"left"}">
|
||||
<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">Request to delete your account</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">
|
||||
<div class="middle-box text-center loginscreen animated fadeInDown ">
|
||||
<p>Please enter your email. We will send you an email with a verification code to delete your account.</p>
|
||||
<div class="uk-width-1-3@m uk-align-center">
|
||||
<!-- REQUEST A VERIFICATION CODE FORM -->
|
||||
<div id="registerForm">
|
||||
<form action="requestToDeleteAccount" method="POST" role="form" class="m-t" id="register_form">
|
||||
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
|
||||
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
|
||||
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
|
||||
<div class="form-group">
|
||||
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
|
||||
<c:remove var="message" scope="session" />
|
||||
<span class="msg_email_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your email.</span>
|
||||
<input id="email" name="email" type="text" placeholder="Email" 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="">
|
||||
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${reCAPTCHA_message}</span>
|
||||
<c:remove var="reCAPTCHA_message" scope="session" />
|
||||
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
|
||||
<div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
|
||||
</div>
|
||||
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
|
||||
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$("#email").focusin(function() {
|
||||
$(this).removeClass('aai-form-danger');
|
||||
$("#server_error").fadeOut();
|
||||
$(".msg_email_error").fadeOut();
|
||||
});
|
||||
</script>
|
||||
<!-- END OF REQUEST A VERIFICATION CODE FORM -->
|
||||
</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> UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A <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 <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>
|
|
@ -0,0 +1,101 @@
|
|||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: sofia
|
||||
Date: 21/5/2018
|
||||
Time: 5:07 μμ
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<% if (session.getAttribute("successDeleteAccount") == null) {
|
||||
String redirectURL = request.getContextPath() + "/error404.jsp";
|
||||
response.sendRedirect(redirectURL);
|
||||
|
||||
} else if (session.getAttribute("successDeleteAccount")!=null) {
|
||||
session.removeAttribute("successDeleteAccount");
|
||||
}
|
||||
%>
|
||||
<html>
|
||||
<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">
|
||||
<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">
|
||||
<title>OpenAIRE - Success </title>
|
||||
</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="{"align":"left"}">
|
||||
<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">Your account has been successfully deleted!</h3>
|
||||
<h4 class="uk-h4">We hope to see you again!</h4>
|
||||
<div class="uk-width-1-3@m uk-align-center">
|
||||
|
||||
</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> UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A <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 <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>
|
|
@ -0,0 +1,130 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: sofia
|
||||
Date: 21/5/2018
|
||||
Time: 2:45 μμ
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<html>
|
||||
<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">
|
||||
<base href=".">
|
||||
<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">
|
||||
<title>OpenAIRE - Verification to delete your account</title>
|
||||
</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="{"align":"left"}">
|
||||
<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">
|
||||
<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">
|
||||
<div class="middle-box text-center loginscreen animated fadeInDown ">
|
||||
<p>An email has been sent to your email address. The email contains a verification code, please paste the verification code in the field below to delete your account.</p>
|
||||
<div class="uk-width-1-3@m uk-align-center">
|
||||
<!-- Validate form -->
|
||||
<div id="registerForm">
|
||||
<form action="verifyToDelete" method="POST" role="form" class="m-t" id="register_form">
|
||||
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
|
||||
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
|
||||
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
|
||||
<div class="form-group">
|
||||
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
|
||||
<c:remove var="message" scope="session" />
|
||||
<span id="server_username_error" class="uk-text-danger uk-text-small uk-float-left">${msg_username_error}</span>
|
||||
<c:remove var="msg_username_error" scope="session" />
|
||||
<input id="username" name="username" type="text" placeholder="Username" class="form-control">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<span id="server_verification_code_error" class="uk-text-danger uk-text-small uk-float-left">${msg_verification_code_error}</span>
|
||||
<c:remove var="msg_verification_code_error" scope="session" />
|
||||
<input id="verification_code" name="verification_code" type="text" placeholder="Verification Code" value="${param.code}" 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-grid-margin uk-first-column">
|
||||
<button type="submit" class="uk-button uk-button-danger" onclick="return validateForm();">Delete Account</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- END OF REGISTER FORM -->
|
||||
<script>
|
||||
$("#username").focusin(function() {
|
||||
$(this).removeClass('aai-form-danger');
|
||||
$("#server_username_error").fadeOut();
|
||||
$("#server_error").fadeOut();
|
||||
});
|
||||
|
||||
$("#verification_code").focusin(function() {
|
||||
$(this).removeClass('aai-form-danger');
|
||||
$("#server_verification_code_error").fadeOut();
|
||||
$("#server_error").fadeOut();
|
||||
});
|
||||
</script>
|
||||
</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> UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A <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 <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>
|
Loading…
Reference in New Issue