7410 |
09 Oct 17 |
nicklas |
1 |
<%-- $Id $ |
7410 |
09 Oct 17 |
nicklas |
2 |
------------------------------------------------------------------ |
7410 |
09 Oct 17 |
nicklas |
Copyright (C) 2017 Nicklas Nordborg |
7410 |
09 Oct 17 |
nicklas |
4 |
|
7410 |
09 Oct 17 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
7410 |
09 Oct 17 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
7410 |
09 Oct 17 |
nicklas |
7 |
|
7410 |
09 Oct 17 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
7410 |
09 Oct 17 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
7410 |
09 Oct 17 |
nicklas |
10 |
as published by the Free Software Foundation; either version 3 |
7410 |
09 Oct 17 |
nicklas |
11 |
of the License, or (at your option) any later version. |
7410 |
09 Oct 17 |
nicklas |
12 |
|
7410 |
09 Oct 17 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
7410 |
09 Oct 17 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7410 |
09 Oct 17 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7410 |
09 Oct 17 |
nicklas |
16 |
GNU General Public License for more details. |
7410 |
09 Oct 17 |
nicklas |
17 |
|
7410 |
09 Oct 17 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
7410 |
09 Oct 17 |
nicklas |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
7410 |
09 Oct 17 |
nicklas |
20 |
------------------------------------------------------------------ |
7410 |
09 Oct 17 |
nicklas |
21 |
|
7410 |
09 Oct 17 |
nicklas |
22 |
--%> |
7410 |
09 Oct 17 |
nicklas |
23 |
<%@ page pageEncoding="UTF-8" session="false" |
7410 |
09 Oct 17 |
nicklas |
24 |
import="net.sf.basedb.core.SessionControl" |
7410 |
09 Oct 17 |
nicklas |
25 |
import="net.sf.basedb.core.Item" |
7410 |
09 Oct 17 |
nicklas |
26 |
import="net.sf.basedb.core.ItemContext" |
7410 |
09 Oct 17 |
nicklas |
27 |
import="net.sf.basedb.core.DbControl" |
7410 |
09 Oct 17 |
nicklas |
28 |
import="net.sf.basedb.core.User" |
7410 |
09 Oct 17 |
nicklas |
29 |
import="net.sf.basedb.clients.web.Base" |
7410 |
09 Oct 17 |
nicklas |
30 |
import="net.sf.basedb.clients.web.util.HTML" |
7410 |
09 Oct 17 |
nicklas |
31 |
import="net.sf.basedb.util.Values" |
7410 |
09 Oct 17 |
nicklas |
32 |
%> |
7410 |
09 Oct 17 |
nicklas |
33 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
7410 |
09 Oct 17 |
nicklas |
34 |
<% |
7410 |
09 Oct 17 |
nicklas |
35 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
7410 |
09 Oct 17 |
nicklas |
36 |
final String ID = sc.getId(); |
7410 |
09 Oct 17 |
nicklas |
37 |
final float scale = Base.getScale(sc); |
7410 |
09 Oct 17 |
nicklas |
38 |
final String root = request.getContextPath()+"/"; |
7410 |
09 Oct 17 |
nicklas |
39 |
final String activePage = request.getParameter("page"); |
7954 |
12 May 21 |
nicklas |
40 |
final DbControl dc = sc.newDbControl(":Verify email"); |
7410 |
09 Oct 17 |
nicklas |
41 |
try |
7410 |
09 Oct 17 |
nicklas |
42 |
{ |
7410 |
09 Oct 17 |
nicklas |
43 |
final User user = User.getById(dc, sc.getLoggedInUserId()); |
7410 |
09 Oct 17 |
nicklas |
44 |
final String title = "Verify email: "+HTML.encodeTags(user.getEmail()); |
7410 |
09 Oct 17 |
nicklas |
45 |
String serverUrl = request.getRequestURL().toString().replace(request.getRequestURI(), root); |
7410 |
09 Oct 17 |
nicklas |
46 |
sc.setSessionSetting("user", user); |
7410 |
09 Oct 17 |
nicklas |
47 |
user.sendEmailVerificationCode(serverUrl); |
7410 |
09 Oct 17 |
nicklas |
48 |
%> |
7410 |
09 Oct 17 |
nicklas |
49 |
<base:page type="popup" title="<%=title%>"> |
7410 |
09 Oct 17 |
nicklas |
50 |
<base:head scripts="~verify_email.js" /> |
7410 |
09 Oct 17 |
nicklas |
51 |
<base:body> |
7410 |
09 Oct 17 |
nicklas |
52 |
<h1><%=title%><base:help helpid="userpreferences.verifyemail" /></h1> |
7410 |
09 Oct 17 |
nicklas |
53 |
<form action="submit_user.jsp?ID=<%=ID%>" method="post" name="verify"> |
7410 |
09 Oct 17 |
nicklas |
54 |
<input type=hidden name="cmd" value="VerifyEmail"> |
7410 |
09 Oct 17 |
nicklas |
55 |
|
7410 |
09 Oct 17 |
nicklas |
56 |
<div class="content"> |
7410 |
09 Oct 17 |
nicklas |
57 |
<table class="fullform bottomborder"> |
7410 |
09 Oct 17 |
nicklas |
58 |
<tr class="align-top"> |
7410 |
09 Oct 17 |
nicklas |
59 |
<th>Verification code</th> |
7410 |
09 Oct 17 |
nicklas |
60 |
<td> |
7410 |
09 Oct 17 |
nicklas |
61 |
<input class="text auto-init" data-auto-init="focus" |
7410 |
09 Oct 17 |
nicklas |
62 |
name="verificationCode" id="verificationCode" |
7410 |
09 Oct 17 |
nicklas |
63 |
type="text" autocomplete="off" |
7410 |
09 Oct 17 |
nicklas |
64 |
maxlength="80" tabindex="0"> |
7410 |
09 Oct 17 |
nicklas |
65 |
</td> |
7410 |
09 Oct 17 |
nicklas |
66 |
</tr> |
7410 |
09 Oct 17 |
nicklas |
67 |
<tr class="dynamic"> |
7410 |
09 Oct 17 |
nicklas |
68 |
<th></th> |
7410 |
09 Oct 17 |
nicklas |
69 |
<td> |
7410 |
09 Oct 17 |
nicklas |
70 |
<div class="messagecontainer note padded"> |
7410 |
09 Oct 17 |
nicklas |
71 |
You have enabled 2-factor login. Before this can enabled, your |
7410 |
09 Oct 17 |
nicklas |
72 |
e-mail address needs to be verified. A 6-digit verification code |
7410 |
09 Oct 17 |
nicklas |
73 |
has been sent to <b><%=HTML.encodeTags(user.getEmail())%></b>. |
7410 |
09 Oct 17 |
nicklas |
74 |
Please enter this code in the form above. |
7410 |
09 Oct 17 |
nicklas |
75 |
</div> |
7410 |
09 Oct 17 |
nicklas |
76 |
</td> |
7410 |
09 Oct 17 |
nicklas |
77 |
</tr> |
7410 |
09 Oct 17 |
nicklas |
78 |
</table> |
7410 |
09 Oct 17 |
nicklas |
79 |
|
7410 |
09 Oct 17 |
nicklas |
80 |
</div> |
7410 |
09 Oct 17 |
nicklas |
81 |
</form> |
7410 |
09 Oct 17 |
nicklas |
82 |
|
7410 |
09 Oct 17 |
nicklas |
83 |
<base:buttongroup subclass="dialogbuttons"> |
7410 |
09 Oct 17 |
nicklas |
84 |
<base:button id="btnOk" title="Ok" /> |
7410 |
09 Oct 17 |
nicklas |
85 |
<base:button id="close" title="Cancel" /> |
7410 |
09 Oct 17 |
nicklas |
86 |
</base:buttongroup> |
7410 |
09 Oct 17 |
nicklas |
87 |
</base:body> |
7410 |
09 Oct 17 |
nicklas |
88 |
</base:page> |
7410 |
09 Oct 17 |
nicklas |
89 |
<% |
7410 |
09 Oct 17 |
nicklas |
90 |
} |
7410 |
09 Oct 17 |
nicklas |
91 |
finally |
7410 |
09 Oct 17 |
nicklas |
92 |
{ |
7410 |
09 Oct 17 |
nicklas |
93 |
if (dc != null) dc.close(); |
7410 |
09 Oct 17 |
nicklas |
94 |
} |
7410 |
09 Oct 17 |
nicklas |
95 |
%> |