7408 |
06 Oct 17 |
nicklas |
1 |
<%-- $Id $ |
7408 |
06 Oct 17 |
nicklas |
2 |
------------------------------------------------------------------ |
7408 |
06 Oct 17 |
nicklas |
Copyright (C) 2017 Nicklas Nordborg |
7408 |
06 Oct 17 |
nicklas |
4 |
|
7408 |
06 Oct 17 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
7408 |
06 Oct 17 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
7408 |
06 Oct 17 |
nicklas |
7 |
|
7408 |
06 Oct 17 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
7408 |
06 Oct 17 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
7408 |
06 Oct 17 |
nicklas |
10 |
as published by the Free Software Foundation; either version 3 |
7408 |
06 Oct 17 |
nicklas |
11 |
of the License, or (at your option) any later version. |
7408 |
06 Oct 17 |
nicklas |
12 |
|
7408 |
06 Oct 17 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
7408 |
06 Oct 17 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7408 |
06 Oct 17 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7408 |
06 Oct 17 |
nicklas |
16 |
GNU General Public License for more details. |
7408 |
06 Oct 17 |
nicklas |
17 |
|
7408 |
06 Oct 17 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
7408 |
06 Oct 17 |
nicklas |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
7408 |
06 Oct 17 |
nicklas |
20 |
------------------------------------------------------------------ |
7408 |
06 Oct 17 |
nicklas |
21 |
|
7408 |
06 Oct 17 |
nicklas |
22 |
@author Nicklas |
7408 |
06 Oct 17 |
nicklas |
23 |
--%> |
7408 |
06 Oct 17 |
nicklas |
24 |
<%@ page pageEncoding="UTF-8" session="false" |
7408 |
06 Oct 17 |
nicklas |
25 |
import="net.sf.basedb.core.Application" |
7408 |
06 Oct 17 |
nicklas |
26 |
import="net.sf.basedb.core.SessionControl" |
7408 |
06 Oct 17 |
nicklas |
27 |
import="net.sf.basedb.core.SessionControl.UnverifiedDeviceInfo" |
7408 |
06 Oct 17 |
nicklas |
28 |
import="net.sf.basedb.core.DbControl" |
7408 |
06 Oct 17 |
nicklas |
29 |
import="net.sf.basedb.clients.web.Base" |
7408 |
06 Oct 17 |
nicklas |
30 |
import="net.sf.basedb.clients.web.util.HTML" |
7408 |
06 Oct 17 |
nicklas |
31 |
import="net.sf.basedb.util.Values" |
7408 |
06 Oct 17 |
nicklas |
32 |
import="java.util.Date" |
7408 |
06 Oct 17 |
nicklas |
33 |
%> |
7408 |
06 Oct 17 |
nicklas |
34 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
7408 |
06 Oct 17 |
nicklas |
35 |
<% |
7408 |
06 Oct 17 |
nicklas |
36 |
final String root = request.getContextPath()+"/"; |
7408 |
06 Oct 17 |
nicklas |
37 |
final String deviceId = Values.getString(request.getParameter("deviceId"), ""); |
7408 |
06 Oct 17 |
nicklas |
38 |
final SessionControl sc = Base.getSessionControl(pageContext, true); |
7408 |
06 Oct 17 |
nicklas |
39 |
final UnverifiedDeviceInfo ui = sc.getUnverifiedDeviceInfo(); |
7408 |
06 Oct 17 |
nicklas |
40 |
final String ID = sc.getId(); |
7954 |
12 May 21 |
nicklas |
41 |
final DbControl dc = sc.newDbControl(":Verify device"); |
7408 |
06 Oct 17 |
nicklas |
42 |
|
7408 |
06 Oct 17 |
nicklas |
43 |
try |
7408 |
06 Oct 17 |
nicklas |
44 |
{ |
7408 |
06 Oct 17 |
nicklas |
45 |
%> |
7408 |
06 Oct 17 |
nicklas |
46 |
<base:page type="default"> |
7408 |
06 Oct 17 |
nicklas |
47 |
<base:head styles="login.css" scripts="~verify_device.js" /> |
7408 |
06 Oct 17 |
nicklas |
48 |
<base:body style="padding-top: 5em;"> |
7408 |
06 Oct 17 |
nicklas |
49 |
<form name="verification" action="login.jsp" method="post"> |
7408 |
06 Oct 17 |
nicklas |
50 |
<input type="hidden" name="cmd" value="VerifyDevice"> |
7408 |
06 Oct 17 |
nicklas |
51 |
<input type="hidden" name="ID" value="<%=ID%>"> |
7408 |
06 Oct 17 |
nicklas |
52 |
<input type="hidden" name="useAutoStartPage" value="1"> |
7408 |
06 Oct 17 |
nicklas |
53 |
<input type="hidden" name="deviceToken" value="<%=HTML.encodeTags(ui.getDeviceToken())%>"> |
7408 |
06 Oct 17 |
nicklas |
54 |
|
7408 |
06 Oct 17 |
nicklas |
55 |
<table style="margin: auto; width: 700px;"> |
7408 |
06 Oct 17 |
nicklas |
56 |
<tr> |
7408 |
06 Oct 17 |
nicklas |
57 |
<td> |
7408 |
06 Oct 17 |
nicklas |
58 |
<div class="messagecontainer help" id="login-help" style="text-align: center; padding: 1em;"> |
7408 |
06 Oct 17 |
nicklas |
59 |
<b style="font-size: 125%;">This is the first time you are logging in from this device</b> |
7451 |
28 Feb 18 |
nicklas |
60 |
<div style="margin-top: 1em;"> |
7451 |
28 Feb 18 |
nicklas |
61 |
A verification code has been sent to your registered email address: |
7451 |
28 Feb 18 |
nicklas |
62 |
<div style="margin: 0.5em; font-weight: bold;"> |
7451 |
28 Feb 18 |
nicklas |
63 |
<%=HTML.encodeTags(ui.getUserName())%> <<%=HTML.encodeTags(ui.getUserEmail())%>> |
7451 |
28 Feb 18 |
nicklas |
64 |
</div> |
7451 |
28 Feb 18 |
nicklas |
65 |
Please enter the verification code in the form below to complete the login.<br> |
7451 |
28 Feb 18 |
nicklas |
66 |
The code can only be used once. |
7451 |
28 Feb 18 |
nicklas |
67 |
</div> |
7408 |
06 Oct 17 |
nicklas |
68 |
</div> |
7408 |
06 Oct 17 |
nicklas |
69 |
|
7408 |
06 Oct 17 |
nicklas |
70 |
<table style="width: 100%; margin-top: 1em; border-collapse: separate;"> |
7408 |
06 Oct 17 |
nicklas |
71 |
<tr> |
7408 |
06 Oct 17 |
nicklas |
72 |
<td class="base-logo"><img src="images/baselogo.png" alt="BASE logo"></td> |
7408 |
06 Oct 17 |
nicklas |
73 |
<td style="width: 515px;"> |
7408 |
06 Oct 17 |
nicklas |
74 |
<div id="loginform"> |
7408 |
06 Oct 17 |
nicklas |
75 |
<table style="width: 100%;"> |
7408 |
06 Oct 17 |
nicklas |
76 |
<tr id="password-row"> |
7408 |
06 Oct 17 |
nicklas |
77 |
<th class="bg-filled-100">Verification code</th> |
7408 |
06 Oct 17 |
nicklas |
78 |
<td><input class="text auto-init" data-auto-init="focus" |
7408 |
06 Oct 17 |
nicklas |
79 |
name="verificationCode" id="verificationCode" |
7408 |
06 Oct 17 |
nicklas |
80 |
type="text" autocomplete="off" |
7408 |
06 Oct 17 |
nicklas |
81 |
maxlength="80" tabindex="0"> |
7408 |
06 Oct 17 |
nicklas |
82 |
</td> |
7408 |
06 Oct 17 |
nicklas |
83 |
</tr> |
7408 |
06 Oct 17 |
nicklas |
84 |
<tr> |
7408 |
06 Oct 17 |
nicklas |
85 |
<th class="bg-filled-100">Remember this device</th> |
7408 |
06 Oct 17 |
nicklas |
86 |
<td> |
7408 |
06 Oct 17 |
nicklas |
87 |
<input type="checkbox" name="rememberDevice" id="rememberDevice" |
7408 |
06 Oct 17 |
nicklas |
88 |
<%=ui.getDefaultRememberDevice() ? "checked" :"" %> |
7408 |
06 Oct 17 |
nicklas |
89 |
style="width: auto;"> |
7408 |
06 Oct 17 |
nicklas |
90 |
</td> |
7408 |
06 Oct 17 |
nicklas |
91 |
<td> |
7408 |
06 Oct 17 |
nicklas |
92 |
<base:button |
7408 |
06 Oct 17 |
nicklas |
93 |
id="btnVerify" |
7408 |
06 Oct 17 |
nicklas |
94 |
image="login.png" title="Continue" |
7408 |
06 Oct 17 |
nicklas |
95 |
/> |
7408 |
06 Oct 17 |
nicklas |
96 |
</td> |
7408 |
06 Oct 17 |
nicklas |
97 |
</tr> |
7408 |
06 Oct 17 |
nicklas |
98 |
<tr><th class="bg-filled-100 subprompt"> </th></tr> |
7408 |
06 Oct 17 |
nicklas |
99 |
</table> |
7408 |
06 Oct 17 |
nicklas |
100 |
</div> |
7408 |
06 Oct 17 |
nicklas |
101 |
</td> |
7408 |
06 Oct 17 |
nicklas |
102 |
</tr> |
7408 |
06 Oct 17 |
nicklas |
103 |
</table> |
7408 |
06 Oct 17 |
nicklas |
104 |
|
7408 |
06 Oct 17 |
nicklas |
105 |
</form> |
7408 |
06 Oct 17 |
nicklas |
106 |
</base:body> |
7408 |
06 Oct 17 |
nicklas |
107 |
</base:page> |
7408 |
06 Oct 17 |
nicklas |
108 |
<% |
7408 |
06 Oct 17 |
nicklas |
109 |
} |
7408 |
06 Oct 17 |
nicklas |
110 |
finally |
7408 |
06 Oct 17 |
nicklas |
111 |
{ |
7408 |
06 Oct 17 |
nicklas |
112 |
if (dc != null) dc.close(); |
7408 |
06 Oct 17 |
nicklas |
113 |
} |
7408 |
06 Oct 17 |
nicklas |
114 |
%> |
7408 |
06 Oct 17 |
nicklas |
115 |
|