4923 |
10 Aug 18 |
nicklas |
1 |
<%@ page |
4923 |
10 Aug 18 |
nicklas |
2 |
pageEncoding="UTF-8" |
4923 |
10 Aug 18 |
nicklas |
3 |
session="false" |
4923 |
10 Aug 18 |
nicklas |
4 |
import="net.sf.basedb.core.SessionControl" |
4923 |
10 Aug 18 |
nicklas |
5 |
import="net.sf.basedb.core.DbControl" |
4923 |
10 Aug 18 |
nicklas |
6 |
import="net.sf.basedb.core.User" |
4923 |
10 Aug 18 |
nicklas |
7 |
import="net.sf.basedb.util.extensions.Extension" |
4923 |
10 Aug 18 |
nicklas |
8 |
import="net.sf.basedb.clients.web.Base" |
4923 |
10 Aug 18 |
nicklas |
9 |
import="net.sf.basedb.clients.web.util.HTML" |
4923 |
10 Aug 18 |
nicklas |
10 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
4923 |
10 Aug 18 |
nicklas |
11 |
%> |
4923 |
10 Aug 18 |
nicklas |
12 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
4923 |
10 Aug 18 |
nicklas |
13 |
<% |
4923 |
10 Aug 18 |
nicklas |
14 |
// Get the JspContext that was created on the main edit page |
4923 |
10 Aug 18 |
nicklas |
15 |
final JspContext jspContext = (JspContext)request.getAttribute(JspContext.ATTRIBUTE_KEY); |
4923 |
10 Aug 18 |
nicklas |
16 |
final Extension extension = (Extension)request.getAttribute(JspContext.EXTENSION_KEY); |
4923 |
10 Aug 18 |
nicklas |
17 |
|
4923 |
10 Aug 18 |
nicklas |
18 |
// The current item is found in the context. NOTE! Can be null if a new item |
4923 |
10 Aug 18 |
nicklas |
19 |
final User user = (User)jspContext.getCurrentItem(); |
4923 |
10 Aug 18 |
nicklas |
20 |
|
4923 |
10 Aug 18 |
nicklas |
21 |
// Get the DbControl and SessionControl used to handle the request (do not close!) |
4923 |
10 Aug 18 |
nicklas |
22 |
final DbControl dc = jspContext.getDbControl(); |
4923 |
10 Aug 18 |
nicklas |
23 |
final SessionControl sc = dc.getSessionControl(); |
4923 |
10 Aug 18 |
nicklas |
24 |
final String ID = sc.getId(); |
4923 |
10 Aug 18 |
nicklas |
25 |
|
4923 |
10 Aug 18 |
nicklas |
26 |
final boolean hasOtp = user != null && user.getExtended("otpSecretKey") != null; |
4923 |
10 Aug 18 |
nicklas |
27 |
final boolean requireOtp = hasOtp || (user != null && Boolean.TRUE.equals(user.getExtended("otpIsRequired"))); |
4923 |
10 Aug 18 |
nicklas |
28 |
|
4923 |
10 Aug 18 |
nicklas |
29 |
String HOME = jspContext.getHome(extension); |
4923 |
10 Aug 18 |
nicklas |
30 |
%> |
4923 |
10 Aug 18 |
nicklas |
31 |
<base:page type="include"> |
4923 |
10 Aug 18 |
nicklas |
32 |
<base:body> |
4923 |
10 Aug 18 |
nicklas |
33 |
<div id="otp-data" class="datacontainer" |
4923 |
10 Aug 18 |
nicklas |
34 |
data-home="<%=HOME%>" |
4923 |
10 Aug 18 |
nicklas |
35 |
></div> |
4923 |
10 Aug 18 |
nicklas |
36 |
<table class="fullcc"><tr><td> |
4923 |
10 Aug 18 |
nicklas |
37 |
|
4924 |
13 Aug 18 |
nicklas |
38 |
<div id="message">Enter a <b>One-time passcode</b> to display the QR code!</div> |
4923 |
10 Aug 18 |
nicklas |
39 |
|
4924 |
13 Aug 18 |
nicklas |
40 |
<div id="no-qrcode"> |
4924 |
13 Aug 18 |
nicklas |
41 |
<input type="text" class="required" name="otp" id="otp" maxlength="6" autocomplete="off"><br> |
4924 |
13 Aug 18 |
nicklas |
42 |
<img src="<%=HOME%>/images/no-qrcode.png"> |
4924 |
13 Aug 18 |
nicklas |
43 |
</div> |
4924 |
13 Aug 18 |
nicklas |
44 |
|
4923 |
10 Aug 18 |
nicklas |
45 |
<img id="qrcode" src="" style="display:none;"> |
4923 |
10 Aug 18 |
nicklas |
46 |
|
4923 |
10 Aug 18 |
nicklas |
47 |
</td></tr></table> |
4923 |
10 Aug 18 |
nicklas |
48 |
</base:body> |
4923 |
10 Aug 18 |
nicklas |
49 |
</base:page> |
4923 |
10 Aug 18 |
nicklas |
50 |
|