twofa-login.xhtml 2.54 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<head>
<title></title>
</head>
<body>
	<f:metadata>
		<f:event type="javax.faces.event.PreRenderViewEvent"
            listener="#{twoFaLoginBean.preRenderView}" />
	</f:metadata>

<ui:composition template="/template/default.xhtml">
	<ui:param name="title" value="#{messages.title}"/>

	<ui:define name="content">

	<h:form id="form" prependId="false">
		<p:panel header="#{messages.twofa_login}">
			<div style="margin-top: 8px; margin-bottom: 16px;"><h:outputText value="#{messages.twofa_login_text}"/></div>
			<div><p:messages showDetail="true" /></div>

			<p:focus conext="baseData" for="tokenText" />

 			<h:panelGrid id="baseData" columns="2" style="margin-bottom: 16px;">
				<p:outputLabel for="@next" value="#{messages.twofa_code}"/>
ls1947's avatar
ls1947 committed
31
				<p:inputText id="tokenText" autocomplete="false" value="#{twoFaLoginBean.tokenInput}"/>
32
33
34
35
36
37
38
39
40
41
42
43
44
 			</h:panelGrid>
			
			<p:commandButton id="check" action="#{twoFaLoginBean.check}" value="#{messages.check}"
				update=":form" />

		</p:panel>
		<p:dataGrid var="token" value="#{twoFaLoginBean.tokenList}" columns="3" styleClass="whitefoot"
				layout="grid" style="margin-top: 16px; margin-bottom: 16px;">
	        <p:panel styleClass="grayback" style="margin-bottom: 0px;">
	        	<f:facet name="header">
	        		<i class="fa fa-fw fa-key"></i>
					<b><h:outputText value="#{token.serial}" /></b>
				</f:facet>
ls1947's avatar
ls1947 committed
45
46
47
48
49
50
51
52
53
54
55
				<p:panelGrid columns="2">
					<p:outputPanel>
						<h:graphicImage width="60px" value="#{resource['img/smartphone.svg']}" alt="Smartphone" rendered="#{token.tokenType == 'TOTP' and token.serial.startsWith('TOTP')}"/>
						<h:graphicImage width="60px" value="#{resource['img/kittoken_small.png']}" alt="Hardware Token" rendered="#{token.tokenType == 'TOTP' and not token.serial.startsWith('TOTP')}"/>
						<h:graphicImage width="60px" value="#{resource['img/yubikey_small.png']}" alt="Yubikey" rendered="#{token.tokenType == 'yubico'}"/>
					</p:outputPanel>
					<p:outputPanel>
						<div><h:outputText value="#{token.tokenType}" /></div>
						<div><h:outputText value="#{token.isactive}" /></div>
					</p:outputPanel>
				</p:panelGrid>
56
57
58
59
60
61
62
63
64
			</p:panel>
		</p:dataGrid>

	</h:form>
	
	</ui:define>
</ui:composition>
</body>
</html>