Revision 51202
Added by Sofia Baltzi about 6 years ago
modules/dnet-openaire-users/trunk/src/main/java/eu/dnetlib/openaire/usermanagement/utils/UrlConstructor.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.openaire.usermanagement.utils; |
2 | 2 |
|
3 | 3 |
import org.apache.log4j.Logger; |
4 |
import org.springframework.beans.factory.annotation.Value; |
|
5 | 4 |
|
6 | 5 |
import javax.servlet.http.HttpServletRequest; |
7 | 6 |
|
... | ... | |
47 | 46 |
|
48 | 47 |
return resultPath; |
49 | 48 |
} |
50 |
|
|
51 |
|
|
52 |
// public static void redirectToHome(HttpServletRequest request){ |
|
53 |
// request.getSession().setAttribute("redirectHomeUrl", oidcHomeUrl); |
|
54 |
// } |
|
55 | 49 |
} |
modules/dnet-openaire-users/trunk/src/main/java/eu/dnetlib/openaire/usermanagement/ActivationCodeServlet.java | ||
---|---|---|
5 | 5 |
import eu.dnetlib.openaire.usermanagement.utils.UrlConstructor; |
6 | 6 |
import org.apache.log4j.Logger; |
7 | 7 |
import org.springframework.beans.factory.annotation.Autowired; |
8 |
import org.springframework.beans.factory.annotation.Value; |
|
8 | 9 |
import org.springframework.web.context.support.SpringBeanAutowiringSupport; |
9 | 10 |
|
10 | 11 |
import javax.servlet.ServletConfig; |
... | ... | |
33 | 34 |
@Autowired |
34 | 35 |
private LDAPActions ldapActions; |
35 | 36 |
|
37 |
@Value("${oidc.home}") |
|
38 |
private String oidcHomeUrl; |
|
36 | 39 |
|
37 | 40 |
private Logger logger = Logger.getLogger(ActivationCodeServlet.class); |
38 | 41 |
|
... | ... | |
48 | 51 |
if (!verificationActions.verificationCodeHasExpired(formUsername)) { |
49 | 52 |
HttpSession session = request.getSession(); |
50 | 53 |
session.setAttribute("username", formUsername); |
54 |
session.setAttribute("homeUrl", oidcHomeUrl); |
|
51 | 55 |
try { |
52 | 56 |
ldapActions.moveUser(formUsername); |
53 | 57 |
} catch (Exception e) { |
... | ... | |
69 | 73 |
printWriter.close(); |
70 | 74 |
|
71 | 75 |
} |
76 |
|
|
77 |
public String getOidcHomeUrl() { |
|
78 |
return oidcHomeUrl; |
|
79 |
} |
|
80 |
|
|
81 |
public void setOidcHomeUrl(String oidcHomeUrl) { |
|
82 |
this.oidcHomeUrl = oidcHomeUrl; |
|
83 |
} |
|
72 | 84 |
} |
modules/dnet-openaire-users/trunk/src/main/java/eu/dnetlib/openaire/usermanagement/RemindUsernameServlet.java | ||
---|---|---|
6 | 6 |
import eu.dnetlib.openaire.usermanagement.utils.UrlConstructor; |
7 | 7 |
import org.apache.log4j.Logger; |
8 | 8 |
import org.springframework.beans.factory.annotation.Autowired; |
9 |
import org.springframework.beans.factory.annotation.Value; |
|
9 | 10 |
import org.springframework.stereotype.Component; |
10 | 11 |
import org.springframework.web.context.support.SpringBeanAutowiringSupport; |
11 | 12 |
|
... | ... | |
15 | 16 |
import javax.servlet.http.HttpServlet; |
16 | 17 |
import javax.servlet.http.HttpServletRequest; |
17 | 18 |
import javax.servlet.http.HttpServletResponse; |
19 |
import javax.servlet.http.HttpSession; |
|
18 | 20 |
import java.io.IOException; |
19 | 21 |
|
20 | 22 |
/** |
... | ... | |
35 | 37 |
@Autowired |
36 | 38 |
private EmailSender emailSender; |
37 | 39 |
|
40 |
@Value("${oidc.home}") |
|
41 |
private String oidcHomeUrl; |
|
42 |
|
|
38 | 43 |
private Logger logger = Logger.getLogger(RemindUsernameServlet.class); |
39 | 44 |
|
40 | 45 |
@Override |
41 | 46 |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { |
42 | 47 |
String formEmail = request.getParameter("email").trim(); |
43 | 48 |
|
49 |
HttpSession session = request.getSession(); |
|
50 |
session.setAttribute("homeUrl", oidcHomeUrl); |
|
51 |
|
|
44 | 52 |
if (formEmail == null){ |
45 | 53 |
request.getSession().setAttribute("message", "Error reading email."); |
46 | 54 |
response.sendRedirect("./remindUsername.jsp"); |
... | ... | |
80 | 88 |
|
81 | 89 |
} |
82 | 90 |
|
91 |
public String getOidcHomeUrl() { |
|
92 |
return oidcHomeUrl; |
|
93 |
} |
|
94 |
|
|
95 |
public void setOidcHomeUrl(String oidcHomeUrl) { |
|
96 |
this.oidcHomeUrl = oidcHomeUrl; |
|
97 |
} |
|
98 |
|
|
83 | 99 |
} |
modules/dnet-openaire-users/trunk/src/main/webapp/successAddPassword.jsp | ||
---|---|---|
16 | 16 |
} else if (session.getAttribute("successAddPassword") != null) { |
17 | 17 |
session.removeAttribute("successAddPassword"); |
18 | 18 |
}%> |
19 |
<META HTTP-EQUIV=Refresh CONTENT="0.5; URL=http://beta.services.openaire.eu/uoa-user-management/openid_connect_login"> |
|
19 |
<%--<META HTTP-EQUIV=Refresh CONTENT="0.5; URL=http://beta.services.openaire.eu/uoa-user-management/openid_connect_login">--%> |
|
20 |
<META HTTP-EQUIV=Refresh CONTENT='0.5; URL=<%= session.getAttribute("homeUrl")%>'> |
|
20 | 21 |
<html lang="en-gb" dir="ltr" vocab="http://schema.org/"> |
21 | 22 |
<head> |
22 | 23 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
modules/dnet-openaire-users/trunk/src/main/webapp/registerSuccess.jsp | ||
---|---|---|
14 | 14 |
} else if (session.getAttribute("registerSuccess") != null) { |
15 | 15 |
session.removeAttribute("registerSuccess"); |
16 | 16 |
}%> |
17 |
<META HTTP-EQUIV=Refresh CONTENT="0.5; URL=http://beta.services.openaire.eu/uoa-user-management/openid_connect_login"> |
|
17 |
<%--<META HTTP-EQUIV=Refresh CONTENT="0.5; URL=http://beta.services.openaire.eu/uoa-user-management/openid_connect_login">--%> |
|
18 |
<META HTTP-EQUIV=Refresh CONTENT='0.5; URL=<%= session.getAttribute("homeUrl")%>'> |
|
18 | 19 |
<html lang="en-gb" dir="ltr" vocab="http://schema.org/"> |
19 | 20 |
<head> |
20 | 21 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
modules/dnet-openaire-users/trunk/src/main/webapp/emailSuccess.jsp | ||
---|---|---|
14 | 14 |
} else if (session.getAttribute("emailSuccess") != null) { |
15 | 15 |
session.removeAttribute("emailSuccess"); |
16 | 16 |
}%> |
17 |
<META HTTP-EQUIV=Refresh CONTENT="0.5; URL=http://beta.services.openaire.eu/uoa-user-management/openid_connect_login"> |
|
17 |
<%--<META HTTP-EQUIV=Refresh CONTENT="0.5; URL=http://beta.services.openaire.eu/uoa-user-management/openid_connect_login">--%> |
|
18 |
<META HTTP-EQUIV=Refresh CONTENT='0.5; URL=<%= session.getAttribute("homeUrl")%>'> |
|
18 | 19 |
<html lang="en-gb" dir="ltr" vocab="http://schema.org/"> |
19 | 20 |
<head> |
20 | 21 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
Also available in: Unified diff
Add redirect home link at registerSuccess.jsp emailSuccess.jsp successAddPassword.jsp and in session at ActivationServlet.java, RemindUsernameServlet.java,