2259 |
28 Feb 14 |
nicklas |
1 |
<%@ page |
2259 |
28 Feb 14 |
nicklas |
2 |
pageEncoding="UTF-8" |
2259 |
28 Feb 14 |
nicklas |
3 |
session="false" |
2259 |
28 Feb 14 |
nicklas |
4 |
import="net.sf.basedb.core.SessionControl" |
2259 |
28 Feb 14 |
nicklas |
5 |
import="net.sf.basedb.core.DbControl" |
2259 |
28 Feb 14 |
nicklas |
6 |
import="net.sf.basedb.core.User" |
2259 |
28 Feb 14 |
nicklas |
7 |
import="net.sf.basedb.util.extensions.Extension" |
2259 |
28 Feb 14 |
nicklas |
8 |
import="net.sf.basedb.clients.web.Base" |
2259 |
28 Feb 14 |
nicklas |
9 |
import="net.sf.basedb.clients.web.util.HTML" |
2259 |
28 Feb 14 |
nicklas |
10 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
2259 |
28 Feb 14 |
nicklas |
11 |
%> |
2259 |
28 Feb 14 |
nicklas |
12 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
2259 |
28 Feb 14 |
nicklas |
13 |
<% |
2259 |
28 Feb 14 |
nicklas |
14 |
// Get the JspContext that was created on the main edit page |
2259 |
28 Feb 14 |
nicklas |
15 |
final JspContext jspContext = (JspContext)request.getAttribute(JspContext.ATTRIBUTE_KEY); |
2259 |
28 Feb 14 |
nicklas |
16 |
final Extension extension = (Extension)request.getAttribute(JspContext.EXTENSION_KEY); |
2259 |
28 Feb 14 |
nicklas |
17 |
|
2259 |
28 Feb 14 |
nicklas |
18 |
// The current item is found in the context. NOTE! Can be null if a new item |
2259 |
28 Feb 14 |
nicklas |
19 |
final User user = (User)jspContext.getCurrentItem(); |
2259 |
28 Feb 14 |
nicklas |
20 |
|
2259 |
28 Feb 14 |
nicklas |
21 |
// Get the DbControl and SessionControl used to handle the request (do not close!) |
2259 |
28 Feb 14 |
nicklas |
22 |
final DbControl dc = jspContext.getDbControl(); |
2259 |
28 Feb 14 |
nicklas |
23 |
final SessionControl sc = dc.getSessionControl(); |
2259 |
28 Feb 14 |
nicklas |
24 |
final String ID = sc.getId(); |
2259 |
28 Feb 14 |
nicklas |
25 |
|
2487 |
05 Jun 14 |
nicklas |
26 |
final String yubiKeyId = user == null ? null : (String)user.getExtended("yubiKeyId"); |
2487 |
05 Jun 14 |
nicklas |
27 |
final String yubiKeySerial = user == null ? null : (String)user.getExtended("yubiKeySerial"); |
2259 |
28 Feb 14 |
nicklas |
28 |
|
2259 |
28 Feb 14 |
nicklas |
29 |
String HOME = jspContext.getHome(extension); |
2259 |
28 Feb 14 |
nicklas |
30 |
%> |
2259 |
28 Feb 14 |
nicklas |
31 |
<base:page type="include"> |
2259 |
28 Feb 14 |
nicklas |
32 |
<base:body> |
2259 |
28 Feb 14 |
nicklas |
33 |
<div id="yubikey-data" class="datacontainer" |
2259 |
28 Feb 14 |
nicklas |
34 |
data-home="<%=HOME%>" |
2259 |
28 Feb 14 |
nicklas |
35 |
></div> |
2259 |
28 Feb 14 |
nicklas |
36 |
<table class="fullform input100"> |
2259 |
28 Feb 14 |
nicklas |
37 |
<tr> |
2259 |
28 Feb 14 |
nicklas |
38 |
<th>Public ID</th> |
2259 |
28 Feb 14 |
nicklas |
39 |
<td> |
2259 |
28 Feb 14 |
nicklas |
40 |
<input type="hidden" name="ep.yubiKeyId" id="yubiKeyId" value="<%=HTML.encodeTags(yubiKeyId) %>"> |
2259 |
28 Feb 14 |
nicklas |
41 |
<span id="yubiKeyId2"><%=yubiKeyId == null ? "<i>No YubiKey</i>" : HTML.encodeTags(yubiKeyId) %></span> |
2259 |
28 Feb 14 |
nicklas |
42 |
</td> |
2259 |
28 Feb 14 |
nicklas |
43 |
<td></td> |
2259 |
28 Feb 14 |
nicklas |
44 |
</tr> |
2259 |
28 Feb 14 |
nicklas |
45 |
<tr> |
2259 |
28 Feb 14 |
nicklas |
46 |
<th>Serial #</th> |
2259 |
28 Feb 14 |
nicklas |
47 |
<td> |
2259 |
28 Feb 14 |
nicklas |
48 |
<input type="text" name="ep.yubiKeySerial" id="yubiKeySerial" |
2259 |
28 Feb 14 |
nicklas |
49 |
value="<%=HTML.encodeTags(yubiKeySerial)%>" |
2259 |
28 Feb 14 |
nicklas |
50 |
maxlength="32"> |
2259 |
28 Feb 14 |
nicklas |
51 |
</td> |
2259 |
28 Feb 14 |
nicklas |
52 |
<td></td> |
2259 |
28 Feb 14 |
nicklas |
53 |
</tr> |
2259 |
28 Feb 14 |
nicklas |
54 |
<tr class="dynamic"> |
2259 |
28 Feb 14 |
nicklas |
55 |
<th>YubiKey</th> |
2259 |
28 Feb 14 |
nicklas |
56 |
<td> |
2259 |
28 Feb 14 |
nicklas |
57 |
<div style="padding: 1em;"> |
2259 |
28 Feb 14 |
nicklas |
58 |
<div id="no-yubikey" style="<%=yubiKeyId == null ? "" : "display: none;"%>"> |
2259 |
28 Feb 14 |
nicklas |
59 |
<div class="messagecontainer note" style="margin: 0;"> |
2259 |
28 Feb 14 |
nicklas |
60 |
This user is currently not configured to login with YubiKey. |
2259 |
28 Feb 14 |
nicklas |
61 |
Assign a YubiKey to this user by inserting a one-time-password |
2259 |
28 Feb 14 |
nicklas |
62 |
in the field below. Press <b>ENTER</b> to verify. |
2259 |
28 Feb 14 |
nicklas |
63 |
</div> |
2259 |
28 Feb 14 |
nicklas |
64 |
|
2259 |
28 Feb 14 |
nicklas |
65 |
<div style="margin-top: 1em;"> |
2259 |
28 Feb 14 |
nicklas |
66 |
<b>YubiKey one-time-password</b><br> |
2259 |
28 Feb 14 |
nicklas |
67 |
<input type="text" name="yubiKeyOtp" id="yubiKeyOtp" autocomplete="off"> |
2259 |
28 Feb 14 |
nicklas |
68 |
</div> |
2259 |
28 Feb 14 |
nicklas |
69 |
|
2259 |
28 Feb 14 |
nicklas |
70 |
<div id="yubikey-verifying" |
2259 |
28 Feb 14 |
nicklas |
71 |
style="display: none; font-style: italic; margin-top: 1em;"> |
2259 |
28 Feb 14 |
nicklas |
72 |
Verifying YubiKey. Please wait... |
2259 |
28 Feb 14 |
nicklas |
73 |
</div> |
2259 |
28 Feb 14 |
nicklas |
74 |
|
2259 |
28 Feb 14 |
nicklas |
75 |
<div id="yubikey-error" class="messagecontainer error" |
2259 |
28 Feb 14 |
nicklas |
76 |
style="display: none; margin: 0; margin-top: 1em;"> |
2259 |
28 Feb 14 |
nicklas |
77 |
</div> |
2259 |
28 Feb 14 |
nicklas |
78 |
|
2259 |
28 Feb 14 |
nicklas |
79 |
</div> |
2259 |
28 Feb 14 |
nicklas |
80 |
|
2259 |
28 Feb 14 |
nicklas |
81 |
<div id="has-yubikey" style="<%=yubiKeyId == null ? "display: none;" : ""%>"> |
2259 |
28 Feb 14 |
nicklas |
82 |
<div class="messagecontainer note" style="margin: 0;"> |
2259 |
28 Feb 14 |
nicklas |
83 |
This user is currently configured to login with YubiKey. |
2259 |
28 Feb 14 |
nicklas |
84 |
Click <b>Remove</b> to remove the YubiKey from this user. |
2259 |
28 Feb 14 |
nicklas |
85 |
</div> |
2259 |
28 Feb 14 |
nicklas |
86 |
|
2259 |
28 Feb 14 |
nicklas |
87 |
<base:buttongroup style="margin-top: 1em;"> |
2259 |
28 Feb 14 |
nicklas |
88 |
<base:button id="btnYubiKeyRemove" title="Remove" /> |
2259 |
28 Feb 14 |
nicklas |
89 |
</base:buttongroup> |
2259 |
28 Feb 14 |
nicklas |
90 |
</div> |
2259 |
28 Feb 14 |
nicklas |
91 |
</div> |
2259 |
28 Feb 14 |
nicklas |
92 |
|
2259 |
28 Feb 14 |
nicklas |
93 |
</td> |
2259 |
28 Feb 14 |
nicklas |
94 |
<td></td> |
2259 |
28 Feb 14 |
nicklas |
95 |
</tr> |
2259 |
28 Feb 14 |
nicklas |
96 |
</table> |
2259 |
28 Feb 14 |
nicklas |
97 |
</base:body> |
2259 |
28 Feb 14 |
nicklas |
98 |
</base:page> |
2259 |
28 Feb 14 |
nicklas |
99 |
|