-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathmanageusers.xhtml
More file actions
86 lines (72 loc) · 3.1 KB
/
manageusers.xhtml
File metadata and controls
86 lines (72 loc) · 3.1 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
template="/WEB-INF/templates/default.xhtml">
<ui:define name="sidebar">
<ui:include src="menu.xhtml"/>
</ui:define>
<ui:define name="content">
<script type="text/javascript">
function confirmDelete() {
return confirm("Are you sure you wish to delete this user? This action cannot be undone.");
}
</script>
<h3>Manage Users</h3>
<h:form>
<h:commandLink action="#{userAction.createUser}" value="Create New User"
rendered="#{identity.hasPermission('seam.account', 'create')}"/>
</h:form>
<h:form>
<h:dataTable
id="threads"
value="#{userSearch.users}"
var="user"
styleClass="security"
cellspacing="0"
headerClass="header"
rowClasses="odd,even"
columnClasses=",,enabled,action">
<h:column width="auto">
<f:facet name="header">
User name
</f:facet>
#{user.username}
</h:column>
<h:column width="auto">
<f:facet name="header">
First name
</f:facet>
#{user.firstName}
</h:column>
<h:column width="auto">
<f:facet name="header">
Last name
</f:facet>
#{user.lastName}
</h:column>
<h:column id="enabled" width="auto">
<f:facet name="header">
Enabled
</f:facet>
<div class="#{user.enabled ? 'checkmark' : 'cross'}"/>
</h:column>
<h:column id="action" width="auto">
<f:facet name="header">
Action
</f:facet>
<ui:fragment rendered="#{identity.hasPermission('seam.identity', 'update')}">
<h:commandLink id="edit" value="Edit" action="#{userAction.editUser(user.username)}"/>
<span> | </span>
</ui:fragment>
<ui:fragment rendered="#{identity.hasPermission('seam.identity', 'delete')}">
<h:commandLink id="delete" value="Delete" action="#{userAction.deleteUser(user.username)}"
onclick="return confirmDelete()"/>
</ui:fragment>
</h:column>
</h:dataTable>
</h:form>
<br style="clear:both"/>
</ui:define>
</ui:composition>