twofa-login.xhtml 3.81 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
30
			<p:outputPanel rendered="#{twoFaLoginBean.reallyReadOnly}">
				<div><h:outputText value="#{messages.twofa_list_really_readonly}"/></div>
				<div><a href="#{twoFaLoginBean.managementUrl}" target="_blank">#{twoFaLoginBean.managementUrl}</a></div>
			</p:outputPanel>

			<p:outputPanel rendered="#{twoFaLoginBean.readOnly and not twoFaLoginBean.reallyReadOnly}">
31
32
33
34
				<div><h:outputText value="#{messages.twofa_list_readonly}"/></div>
				<div><a href="#{twoFaLoginBean.managementUrl}" target="_blank">#{twoFaLoginBean.managementUrl}</a></div>
			</p:outputPanel>
			
35
36
37
38
39
40
41
			<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
42
				<p:inputText id="tokenText" autocomplete="false" value="#{twoFaLoginBean.tokenInput}"/>
43
44
45
46
47
48
 			</h:panelGrid>
			
			<p:commandButton id="check" action="#{twoFaLoginBean.check}" value="#{messages.check}"
				update=":form" />

		</p:panel>
49
50
		<p:dataGrid var="token" value="#{twoFaLoginBean.tokenList}" rendered="#{not twoFaLoginBean.reallyReadOnly}"
				columns="3" styleClass="whitefoot"
51
52
53
54
55
56
				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
57
58
59
60
61
				<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'}"/>
62
						<h:graphicImage width="60px" value="#{resource['img/tanlist.svg']}" alt="Backup TAN List" rendered="#{token.tokenType == 'HMAC'}"/>
ls1947's avatar
ls1947 committed
63
					</p:outputPanel>
64
65
66
67
68
69
70
					<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
71
				</p:panelGrid>
72
73
74
75
76
77
78
79
80
			</p:panel>
		</p:dataGrid>

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