Verwaltung von LDAP Accounts und Gruppen
Peter Hormanns
2021-12-07 694d20e4b72fbb2283a8f4230ee781e2839d9273
commit | author | age
90d4d7 1 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
PH 2 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
3 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
4 <fmt:setBundle basename="de.jalin.ldapadmin.users"/>
5 <!DOCTYPE html>
6 <html lang="{language}">
7 <jsp:include page="template/header.jsp"/>
8 <body>
9     <jsp:include page="template/navbar.jsp"/>
10     <c:url var="formaction" value="/user/${user.dn}?op=${operation}" />
11     <c:if test="${ operation eq 'password' }">
12         <c:url var="formaction" value="/profile/${user.dn}?op=${operation}" />
13     </c:if>
14     <div class="container">
15         <h1 class="col-sm-offset-3">${user.firstname} ${user.lastname}<c:if test="${ operation eq 'create' }"><fmt:message key="users.title.new"/></c:if></h1>
16         <c:if test="${ not empty errormessage }">
17             <div class="alert alert-error col-sm-offset-3">
18               <a class="close" data-dismiss="alert">×</a>
19               <strong><fmt:message key="users.error.title"/></strong> ${errormessage}
20             </div>
21         </c:if>
22         <c:if test="${ not empty successmessage }">
23             <div class="alert alert-success col-sm-offset-3">
24               <a class="close" data-dismiss="alert">×</a>
25               ${successmessage}
26             </div>
27         </c:if>
28         <c:if test="${ operation eq 'profile' }">
29             <div class="control-group">
30                 <div class="btn-group col-sm-12">
31                     <c:url var="edituserurl" value="/profile/${user.dn}?op=password" />
32                     <a href="${edituserurl}" class="btn btn-default pull-right additional-space-bottom"><fmt:message key="users.operations.changepassword"/></a>
33                 </div>
34             </div>
35         </c:if>
36         <c:if test="${ operation eq 'view' }">
37             <div class="control-group">
38                 <div class="btn-group col-sm-12">
39                     <c:url var="edituserurl" value="/user/${user.dn}?op=edit" />
40                     <a href="${edituserurl}" class="btn btn-default pull-right additional-space-bottom"><fmt:message key="users.operations.edit"/></a>
41                 </div>
42             </div>
43         </c:if>
44         <c:if test="${ operation eq 'delete' }">
45             <div class="control-group">
46                 <div class="col-sm-12">
47                     <p class="col-sm-offset-3"><fmt:message key="users.confirm.delete"/></p>
48                 </div>
49             </div>
50         </c:if>
51         <c:if test="${ (operation ne 'view') and (operation ne 'profile') }">
52             <div class="additional-space-top">&nbsp;</div>
53         </c:if>
54         <div class="control-group">
55             <form class="form-horizontal" method="post" action="${formaction}">
56                 <fieldset ${formdisabled} class="col-sm-12">
57                     <div class="form-group">
58                         <label for="login" class="col-sm-3 control-label"><fmt:message key="users.label.login"/></label> 
59                         <div class="col-sm-9">
60                             <input ${iddisabled}
61                                 type="text" class="form-control" id="login" name="login"
62                                 value="${user.login}" placeholder="Enter login">
63                         </div>
64                     </div>
65                     <c:if test="${ operation ne 'password' }">
66                         <div class="form-group">
67                             <label for="firstname" class="col-sm-3 control-label"><fmt:message key="users.label.firstname"/></label> 
68                             <div class="col-sm-9">
69                                 <input
70                                     type="text" class="form-control" id="firstname" name="firstname"
71                                     value="${user.firstname}" placeholder="Enter firstname">
72                             </div>
73                         </div>
74                         <div class="form-group">
75                             <label for="lastname" class="col-sm-3 control-label"><fmt:message key="users.label.lastname"/></label> 
76                             <div class="col-sm-9">
77                                 <input
78                                     type="text" class="form-control" id="lastname" name="lastname"
79                                     value="${user.lastname}" placeholder="Enter lastname">
80                             </div>
81                         </div>
82                         <div class="form-group">
83                             <label for="email" class="col-sm-3 control-label"><fmt:message key="users.label.email"/></label> 
84                             <div class="col-sm-9">
85                                 <input
86                                     type="email" class="form-control" id="email" name="email"
694d20 87                                     value="${user.email}" placeholder="Enter email">
90d4d7 88                             </div>
PH 89                         </div>
90                         <div class="form-group">
91                             <label for="phone" class="col-sm-3 control-label"><fmt:message key="users.label.phone"/></label> 
92                             <div class="col-sm-9">
93                                 <input
94                                     type="tel" class="form-control" id="phone" name="phone"
95                                     value="${user.phone}" placeholder="Enter phone">
96                             </div>
97                         </div>
98                         <div class="form-group">
99                             <label for="mobile" class="col-sm-3 control-label"><fmt:message key="users.label.mobile"/></label> 
100                             <div class="col-sm-9">
101                                 <input
102                                     type="tel" class="form-control" id="mobile" name="mobile"
103                                     value="${user.mobile}" placeholder="Enter mobile">
104                             </div>
105                         </div>
106                     </c:if>
107                     <c:if test="${ (operation eq 'create') or (operation eq 'edit') or (operation eq 'password') }">
108                         <div class="form-group">
109                             <label for="password" class="col-sm-3 control-label"><fmt:message key="users.label.password"/></label> 
110                             <div class="col-sm-9">
111                                 <input
e0b249 112                                     type="password" class="form-control" id="password" name="password"
7dfe97 113                                     value="" placeholder="Enter password">
90d4d7 114                             </div>
PH 115                         </div>
116                         <div class="form-group">
117                             <label for="password2" class="col-sm-3 control-label"><fmt:message key="users.label.password.repeat"/></label> 
118                             <div class="col-sm-9">
119                                 <input
120                                     type="password" class="form-control" id="password2" name="password2"
121                                     value="" placeholder="Repeat password">
122                             </div>
123                         </div>
124                     </c:if>
125                     <c:if test="${ operation ne 'password' }">
126                         <div class="form-group">
127                             <label for="membership" class="col-sm-3 control-label"><fmt:message key="users.label.memberof"/></label> 
128                             <div class="col-sm-9" id ="membership">
129                                 <c:forEach items="${groups}" var="groupentry" >
e0b249 130                                     <div class="checkbox">
PH 131                                         <jsp:useBean id="checker" class="de.jalin.ldapadmin.beans.MembershipCheck" />
132                                         <jsp:setProperty property="user" name="checker" value="${user}" />
133                                         <jsp:setProperty property="group" name="checker" value="${groupentry.value}" />
134                                         <label><input type="checkbox" id="${groupentry.value.name}" name="check_group_${groupentry.value.name}" ${checker.checked}>${groupentry.value.name}</label>
135                                     </div>
90d4d7 136                                 </c:forEach>
PH 137                             </div>
138                         </div>
139                     </c:if>
140                     <c:if test="${ formdisabled ne 'disabled' }">
141                         <button type="submit" class="col-sm-offset-3 btn btn-primary additional-space-top"><fmt:message key="users.operations.update"/></button>
142                     </c:if>
143                 </fieldset>
144                 <c:if test="${ operation eq 'delete' }">
145                     <button type="submit" class="col-sm-offset-3 btn btn-primary additional-space-top"><fmt:message key="users.operations.delete"/></button>
146                 </c:if>
147             </form>
148         </div>
149     </div>
150     <jsp:include  page="template/footer.jsp"/>
151 </body>
152 </html>