twofa-login.xhtml 3.45 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
<!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}">
24
25
26
27
28
29

			<p:outputPanel rendered="#{twoFaLoginBean.readOnly}">
				<div><h:outputText value="#{messages.twofa_list_readonly}"/></div>
				<div><a href="#{twoFaLoginBean.managementUrl}" target="_blank">#{twoFaLoginBean.managementUrl}</a></div>
			</p:outputPanel>
			
30
31
32
33
34
35
36
			<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
37
				<p:inputText id="tokenText" autocomplete="false" value="#{twoFaLoginBean.tokenInput}"/>
38
39
40
41
42
43
44
45
46
47
48
49
50
 			</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
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'}"/>
56
						<h:graphicImage width="60px" value="#{resource['img/tanlist.svg']}" alt="Backup TAN List" rendered="#{token.tokenType == 'HMAC'}"/>
ls1947's avatar
ls1947 committed
57
					</p:outputPanel>
58
59
60
61
62
63
64
					<h:panelGroup>
						<h:outputText value="#{messages.twofa_tokentype_tanlist}" rendered="#{token.tokenType == 'HMAC' and token.serial.startsWith('OATH')}"/>
						<h:outputText value="#{messages.twofa_tokentype_totp}" rendered="#{token.tokenType == 'TOTP' and token.serial.startsWith('TOTP')}"/>
						<h:outputText value="#{messages.twofa_tokentype_totp_hardware}" rendered="#{token.tokenType == 'TOTP' and not token.serial.startsWith('TOTP')}"/>
						<h:outputText value="#{messages.twofa_tokentype_tanlist}" rendered="#{token.tokenType == 'HOTP'}"/>
						<h:outputText value="#{messages.twofa_tokentype_yubikey}" rendered="#{token.tokenType == 'yubico'}"/>
					</h:panelGroup>
ls1947's avatar
ls1947 committed
65
				</p:panelGrid>
66
67
68
69
70
71
72
73
74
			</p:panel>
		</p:dataGrid>

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