twofa.xhtml 2.53 KB
Newer Older
michael.simon's avatar
michael.simon committed
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
<?xml version='1.0' encoding='UTF-8' ?>
<!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:bw="http://www.scc.kit.edu/bwfacelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:of="http://omnifaces.org/functions">
<head>
<title></title>
</head>
<body>

<f:view>
<f:metadata>
	<f:event type="javax.faces.event.PreRenderViewEvent"
           listener="#{twoFaUserBean.preRenderView}" />
</f:metadata>

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

	<ui:define name="content">
	<h:form id="form">
27
			<div><p:messages showDetail="true" /></div>
ls1947's avatar
ls1947 committed
28
29
30
31
32
33
34
35
36
37
38

		<p:panel header="#{messages.twofa_list}" rendered="#{twoFaUserBean.readOnly}">
			
			<div><h:outputText value="#{messages.twofa_list_readonly}"/></div>
			<div><a href="#{twoFaUserBean.managementUrl}" target="_blank">#{twoFaUserBean.managementUrl}</a></div>
			
			<p:repeat var="token" value="#{twoFaUserBean.tokenList}">
				<div><h:outputText value="#{token.serial}" /></div>
			</p:repeat>
		</p:panel>

ls1947's avatar
ls1947 committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
		<p:dataGrid var="token" value="#{twoFaUserBean.tokenList}" columns="1" styleClass="whitefoot"
				layout="grid" style="margin-bottom: 16px;" rendered="#{! twoFaUserBean.readOnly}">
	        <f:facet name="header">#{messages.twofa_list}</f:facet>
	        <p:panel styleClass="grayback" style="margin-bottom: 0px;">
	        	<f:facet name="header">
					<div><h:outputText value="#{token.serial}" /></div>
				</f:facet>
				<div><h:outputText value="#{token.tokenType}" /></div>
				<div><h:outputText value="#{token.isactive}" /></div>
				<p:commandButton action="#{twoFaUserBean.disableToken(token.serial)}" value="Disable" 
					update="@form" rendered="#{token.isactive}"/>
				<p:commandButton action="#{twoFaUserBean.enableToken(token.serial)}" value="Enable" 
					update="@form" rendered="#{! token.isactive}"/>
			</p:panel>
			<f:facet name="footer">
				<p:commandButton action="#{twoFaUserBean.createAuthenticatorToken()}" value="Create" update="@form"></p:commandButton>
			</f:facet>
		</p:dataGrid>
57
58
59
60
		
		<p:panel rendered="#{! twoFaUserBean.readOnly}">
			<h:outputText value="#{twoFaUserBean.createTokenResponse.detail.googleurl.img}" escape="false" />
			<h:outputText value="#{twoFaUserBean.createTokenResponse.detail.serial}"/>
michael.simon's avatar
michael.simon committed
61
62
63
64
65
66
67
68
		</p:panel>
	</h:form>
	</ui:define>

</ui:composition>
</f:view>
</body>
</html>