1
|
<%@ page language="java"%>
|
2
|
<%@ page import="java.util.Set,java.util.Map,java.util.Vector,edu.ucsb.nceas.utilities.*" %>
|
3
|
<%
|
4
|
/**
|
5
|
* '$RCSfile$'
|
6
|
* Copyright: 2008 Regents of the University of California and the
|
7
|
* National Center for Ecological Analysis and Synthesis
|
8
|
* For Details: http://www.nceas.ucsb.edu/
|
9
|
*
|
10
|
* '$Author: daigle $'
|
11
|
* '$Date: 2008-07-11 10:00:44 -0700 (Fri, 11 Jul 2008) $'
|
12
|
* '$Revision: 4100 $'
|
13
|
*
|
14
|
* This program is free software; you can redistribute it and/or modify
|
15
|
* it under the terms of the GNU General Public License as published by
|
16
|
* the Free Software Foundation; either version 2 of the License, or
|
17
|
* (at your option) any later version.
|
18
|
*
|
19
|
* This program is distributed in the hope that it will be useful,
|
20
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22
|
* GNU General Public License for more details.
|
23
|
*
|
24
|
* You should have received a copy of the GNU General Public License
|
25
|
* along with this program; if not, write to the Free Software
|
26
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
27
|
*/
|
28
|
%>
|
29
|
|
30
|
<%
|
31
|
PropertiesMetaData propMetadata =
|
32
|
(PropertiesMetaData)request.getAttribute("metadata");
|
33
|
Vector<String> ldapOrganizations =
|
34
|
(Vector<String>)request.getAttribute("orgList");
|
35
|
Map<Integer, MetaDataGroup> groupMap =
|
36
|
(Map<Integer, MetaDataGroup>)request.getAttribute("groupMap");
|
37
|
%>
|
38
|
|
39
|
<html>
|
40
|
<head>
|
41
|
|
42
|
<title>LDAP Configuration</title>
|
43
|
<link rel="stylesheet" type="text/css"
|
44
|
href="<%= request.getContextPath() %>/admin/admin.css"></link>
|
45
|
<script language="JavaScript" type="text/JavaScript" src="<%= request.getContextPath() %>/admin/admin.js"></script>
|
46
|
<script language="JavaScript" type="text/JavaScript" src="<%= request.getContextPath() %>/help/help.js"></script>
|
47
|
|
48
|
</head>
|
49
|
<body>
|
50
|
<img src="<%= request.getContextPath() %>/metacat-logo.png" width="100px" align="right"/>
|
51
|
<h2>LDAP Configuration</h2>
|
52
|
Enter authentication service properties here.
|
53
|
<br class="ldap-header">
|
54
|
|
55
|
<%@ include file="./page-message-section.jsp"%>
|
56
|
|
57
|
|
58
|
<form method="POST" name="configuration_form" action="<%= request.getContextPath() %>/admin"
|
59
|
onsubmit="return submitForm(this);">
|
60
|
<%
|
61
|
Map<Integer, MetaDataProperty> globalPropertiesMap = propMetadata.getPropertiesInGroup(1);
|
62
|
MetaDataGroup globalGroup = groupMap.get(new Integer(1));
|
63
|
%>
|
64
|
<h3><%=globalGroup.getName()%></h3>
|
65
|
<hr class="config-line">
|
66
|
<%
|
67
|
if (globalGroup.getComment() != null) {
|
68
|
%>
|
69
|
<div class="heading-comment"><%=globalGroup.getComment()%></div><br>
|
70
|
<%
|
71
|
}
|
72
|
%>
|
73
|
<br>
|
74
|
<table class="config-section">
|
75
|
<%
|
76
|
Set<Integer> globalIdSet = globalPropertiesMap.keySet();
|
77
|
for (Integer globalId : globalIdSet) {
|
78
|
MetaDataProperty globalProperty = globalPropertiesMap.get(globalId);
|
79
|
%>
|
80
|
<tr>
|
81
|
<td class="config-property-label">
|
82
|
<label for="<%= globalProperty.getKey() %>" title="<%= globalProperty.getDescription() %>"><%=globalProperty.getLabel()%></label>
|
83
|
</td>
|
84
|
<td class="config-property-input" >
|
85
|
<input id="<%= globalProperty.getKey() %>" name="<%= globalProperty.getKey() %>"
|
86
|
value="<%= request.getAttribute(globalProperty.getKey()) %>"
|
87
|
type="text"
|
88
|
alt="LDAP server URL"/>
|
89
|
</td>
|
90
|
<td class="config-question-mark">
|
91
|
<img src="style/images/question-mark.gif" onClick="helpWindow('<%= request.getContextPath() %>', '<%= globalProperty.getHelpFile() %>')"/><br/>
|
92
|
</td>
|
93
|
</tr>
|
94
|
<%
|
95
|
}
|
96
|
Map<Integer, MetaDataProperty> orgPropertyMap = propMetadata.getPropertiesInGroup(2);
|
97
|
MetaDataGroup orgGroup = groupMap.get(new Integer(2));
|
98
|
Set<Integer> orgIdSet = orgPropertyMap.keySet();
|
99
|
%>
|
100
|
</table>
|
101
|
<h3><%=orgGroup.getName()%></h3>
|
102
|
<hr class="config-line">
|
103
|
<%
|
104
|
if (orgGroup.getComment() != null) {
|
105
|
%>
|
106
|
<div class="heading-comment"><%= orgGroup.getComment() %></div>
|
107
|
<%
|
108
|
}
|
109
|
%>
|
110
|
<br>
|
111
|
<%
|
112
|
for (String orgName : ldapOrganizations) {
|
113
|
%>
|
114
|
<table class="config-section">
|
115
|
<tr>
|
116
|
<td class="config-checkbox">
|
117
|
<input class="org" type="checkbox" name="<%= orgName %>.cb" onClick="toggleHiddenTable(this, 'hiding-section-<%= orgName %>')"/>
|
118
|
</td>
|
119
|
<td class="config-checkbox-label">
|
120
|
<label for="<%= orgName %>.cb"><%=orgName%></label>
|
121
|
</td>
|
122
|
<td class="config-question-mark">
|
123
|
<img src="style/images/question-mark.gif"
|
124
|
alt="blah"
|
125
|
title="blah"/>
|
126
|
</td>
|
127
|
</tr>
|
128
|
</table>
|
129
|
<table class="config-section-hiding" id="hiding-section-<%= orgName %>">
|
130
|
<%
|
131
|
for (Integer orgId : orgIdSet) {
|
132
|
MetaDataProperty orgProperty = orgPropertyMap.get(orgId);
|
133
|
String orgKeyName = orgProperty.getKey() + "." + orgName;
|
134
|
%>
|
135
|
<tr>
|
136
|
<td class="config-property-label" >
|
137
|
<label for="<%= orgKeyName %>" title="<%= orgProperty.getDescription() %>"><%= orgProperty.getLabel() %></label>
|
138
|
</td>
|
139
|
<td class="config-property-input" >
|
140
|
<input name="<%= orgKeyName %>"
|
141
|
value="<%= request.getAttribute(orgKeyName) %>"
|
142
|
<%
|
143
|
if (orgProperty.getFieldType().equals("password")) {
|
144
|
%>
|
145
|
type="password"
|
146
|
<%
|
147
|
}
|
148
|
%>
|
149
|
alt="List of administrators for this installation in LDAP DN syntax (colon separated)"/>
|
150
|
</td>
|
151
|
<td class="config-question-mark">
|
152
|
<img src="style/images/question-mark.gif" onClick="helpWindow('<%= request.getContextPath() %>', '<%= orgProperty.getHelpFile() %>')"/>
|
153
|
</td>
|
154
|
</tr>
|
155
|
<%
|
156
|
}
|
157
|
%>
|
158
|
</table>
|
159
|
<%
|
160
|
}
|
161
|
%>
|
162
|
|
163
|
<input type="hidden" name="configureType" value="ldap"/>
|
164
|
<input type="hidden" name="processForm" value="true"/>
|
165
|
<input class="left-button" type="submit" value="Save"/>
|
166
|
<input class="button" type="button" value="Cancel" onClick="forward('./admin')">
|
167
|
|
168
|
</form>
|
169
|
|
170
|
</body>
|
171
|
</html>
|