1
|
package eu.dnetlib.openaire.usermanagement;
|
2
|
|
3
|
import eu.dnetlib.openaire.user.utils.LDAPActions;
|
4
|
import eu.dnetlib.openaire.user.utils.VerificationActions;
|
5
|
import org.springframework.beans.factory.annotation.Autowired;
|
6
|
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
|
7
|
|
8
|
import javax.servlet.ServletConfig;
|
9
|
import javax.servlet.ServletException;
|
10
|
import javax.servlet.http.HttpServlet;
|
11
|
import javax.servlet.http.HttpServletRequest;
|
12
|
import javax.servlet.http.HttpServletResponse;
|
13
|
import java.io.IOException;
|
14
|
import java.io.PrintWriter;
|
15
|
|
16
|
/**
|
17
|
* Created by kiatrop on 28/9/2017.
|
18
|
*/
|
19
|
public class ResetPasswordServlet extends HttpServlet {
|
20
|
|
21
|
public void init(ServletConfig config) throws ServletException {
|
22
|
super.init(config);
|
23
|
SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this,
|
24
|
config.getServletContext());
|
25
|
}
|
26
|
|
27
|
@Autowired
|
28
|
private VerificationActions verificationActions;
|
29
|
|
30
|
@Autowired
|
31
|
private LDAPActions ldapActions;
|
32
|
|
33
|
@Override
|
34
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
35
|
response.setContentType("text/html");
|
36
|
PrintWriter printWriter = response.getWriter();
|
37
|
|
38
|
String password = request.getParameter("password");
|
39
|
String confirmPassword = request.getParameter("confirmPassword");
|
40
|
|
41
|
if (password.equals(confirmPassword)) {
|
42
|
//TODO update ldap
|
43
|
//ldapActions.update()
|
44
|
}
|
45
|
|
46
|
response.sendRedirect("./success.jsp");
|
47
|
printWriter.close();
|
48
|
}
|
49
|
}
|