1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <xsl:stylesheet version="1.0"
|
---|
3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
4 | xmlns:java="http://xml.apache.org/xslt/java"
|
---|
5 | xmlns:gslib="http://www.greenstone.org/skinning"
|
---|
6 | xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
|
---|
7 | extension-element-prefixes="java util"
|
---|
8 | exclude-result-prefixes="java util">
|
---|
9 |
|
---|
10 | <!-- use the 'main' layout -->
|
---|
11 | <xsl:import href="layouts/main.xsl"/>
|
---|
12 | <xsl:output method="html"/>
|
---|
13 |
|
---|
14 | <!-- set page title -->
|
---|
15 | <xsl:template name="pageTitle">
|
---|
16 | <xsl:choose>
|
---|
17 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'AddUser'">
|
---|
18 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_a_new_user_title')"/>
|
---|
19 | </xsl:when>
|
---|
20 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'Register'">
|
---|
21 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.register')"/>
|
---|
22 | </xsl:when>
|
---|
23 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'EditUser'">
|
---|
24 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.edit_user_information')"/>
|
---|
25 | </xsl:when>
|
---|
26 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'AccountSettings'">
|
---|
27 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_settings')"/>
|
---|
28 | </xsl:when>
|
---|
29 | <xsl:otherwise>
|
---|
30 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.authentication')"/>
|
---|
31 | </xsl:otherwise>
|
---|
32 | </xsl:choose>
|
---|
33 | </xsl:template>
|
---|
34 |
|
---|
35 | <!-- set page breadcrumbs -->
|
---|
36 | <xsl:template name="breadcrumbs">
|
---|
37 | <gslib:siteLink/><gslib:rightArrow/><a href="{$library_name}/admin/ListUsers"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.authentication')"/></a>
|
---|
38 | </xsl:template>
|
---|
39 |
|
---|
40 | <xsl:template match="/page">
|
---|
41 | <xsl:if test="/page/pageResponse/error">
|
---|
42 | <div id="gs_error" class="ui-state-error ui-corner-all">
|
---|
43 | <span class="ui-icon ui-icon-alert" style="float: left;"><xsl:text> </xsl:text></span><xsl:value-of select="/page/pageResponse/error"/>
|
---|
44 | </div>
|
---|
45 | <br/>
|
---|
46 | </xsl:if>
|
---|
47 | <div id="main">
|
---|
48 | <xsl:choose>
|
---|
49 | <!-- ********** -->
|
---|
50 | <!-- LOGIN PAGE -->
|
---|
51 | <!-- ********** -->
|
---|
52 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'Login'">
|
---|
53 | <form method="POST" action="{$library_name}/admin/{/page/pageRequest/paramList/param[@name = 's1.authpage']/@value}">
|
---|
54 | <table id="loginTable">
|
---|
55 | <tr><td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/>: </td><td><input type="text" name="username"/></td></tr>
|
---|
56 | <tr><td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password')"/>: </td><td><input type="password" name="password"/></td></tr>
|
---|
57 | <tr><td><input type="submit" value="Login"/></td><td><xsl:text> </xsl:text></td></tr>
|
---|
58 | </table>
|
---|
59 | </form>
|
---|
60 | <script type="text/javascript">
|
---|
61 | <xsl:text disable-output-escaping="yes">
|
---|
62 | {
|
---|
63 | $("#loginTable input[name=\"username\"]").focus();
|
---|
64 | }
|
---|
65 | </xsl:text>
|
---|
66 | </script>
|
---|
67 | </xsl:when>
|
---|
68 |
|
---|
69 | <!-- *************** -->
|
---|
70 | <!-- LIST USERS PAGE -->
|
---|
71 | <!-- *************** -->
|
---|
72 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'ListUsers'">
|
---|
73 | <table id="userListTable">
|
---|
74 | <tr class="ui-widget-header">
|
---|
75 | <td colspan="7"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_of_current_users_title')"/></td>
|
---|
76 | </tr>
|
---|
77 | <tr class="ui-state-default">
|
---|
78 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/></td>
|
---|
79 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_status')"/></td>
|
---|
80 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups')"/></td>
|
---|
81 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/></td>
|
---|
82 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.email')"/></td>
|
---|
83 | <td><xsl:text> </xsl:text></td>
|
---|
84 | <td><xsl:text> </xsl:text></td>
|
---|
85 | </tr>
|
---|
86 | <xsl:for-each select="/page/pageResponse/authenticationNode/service/userNodeList/userNode">
|
---|
87 | <tr class="ui-widget-content">
|
---|
88 | <td><xsl:value-of select="@username"/></td>
|
---|
89 | <td>
|
---|
90 | <xsl:choose>
|
---|
91 | <xsl:when test="@status = 'true'">
|
---|
92 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/>
|
---|
93 | </xsl:when>
|
---|
94 | <xsl:otherwise>
|
---|
95 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/>
|
---|
96 | </xsl:otherwise>
|
---|
97 | </xsl:choose>
|
---|
98 | </td>
|
---|
99 | <td><xsl:value-of select='util:replace(@groups, ",", " ")'/></td>
|
---|
100 | <td><xsl:value-of select="@comment"/></td>
|
---|
101 | <td><xsl:value-of select="@email"/></td>
|
---|
102 | <td><a href="{$library_name}/admin/EditUser?s1.username={@username}"><button><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.edit')"/></button></a></td>
|
---|
103 | <td>
|
---|
104 | <xsl:variable name="user-pos">username<xsl:number value="position()"/></xsl:variable>
|
---|
105 | <xsl:variable name="message-pos">confirmMessage<xsl:number value="position()"/></xsl:variable>
|
---|
106 | <form method="GET" action="{$library_name}/admin/PerformDeleteUser">
|
---|
107 | <input type="hidden" name="s1.username" value="{@username}"/>
|
---|
108 | <input id="delUser{@username}" type="submit" value="{util:getInterfaceText($interface_name, /page/@lang, 'authen.delete')}"/>
|
---|
109 | <script type="text/javascript">
|
---|
110 | <xsl:text disable-output-escaping="yes">
|
---|
111 | {
|
---|
112 | var </xsl:text><xsl:value-of select="$user-pos"/><xsl:text disable-output-escaping="yes"> = "</xsl:text><xsl:value-of select="@username"/><xsl:text disable-output-escaping="yes">";
|
---|
113 | var </xsl:text><xsl:value-of select="$message-pos"/><xsl:text disable-output-escaping="yes"> = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.delete_warning')"/><xsl:text disable-output-escaping="yes">" + </xsl:text><xsl:value-of select="$user-pos"/><xsl:text disable-output-escaping="yes"> + "?";
|
---|
114 | var button = $("#delUser" + </xsl:text><xsl:value-of select="$user-pos"/><xsl:text disable-output-escaping="yes">);
|
---|
115 | button.click(function()
|
---|
116 | {
|
---|
117 | if(confirm(</xsl:text><xsl:value-of select="$message-pos"/><xsl:text disable-output-escaping="yes">))
|
---|
118 | {
|
---|
119 | return true;
|
---|
120 | }
|
---|
121 | else
|
---|
122 | {
|
---|
123 | return false;
|
---|
124 | }
|
---|
125 | });
|
---|
126 | }
|
---|
127 | </xsl:text>
|
---|
128 | </script>
|
---|
129 | </form>
|
---|
130 | </td>
|
---|
131 | </tr>
|
---|
132 | </xsl:for-each>
|
---|
133 | </table>
|
---|
134 | <div id="auth_navbar">
|
---|
135 | <!-- Add User link-->
|
---|
136 | <span class="ui-state-default ui-corner-all">
|
---|
137 | <a href="{$library_name}/admin/AddUser"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_a_new_user')"/></a>
|
---|
138 | </span>
|
---|
139 | </div>
|
---|
140 | </xsl:when>
|
---|
141 |
|
---|
142 | <!-- ********************************* -->
|
---|
143 | <!-- EDIT USER / ACCOUNT SETTINGS PAGE -->
|
---|
144 | <!-- ********************************* -->
|
---|
145 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'EditUser' or /page/pageResponse/authenticationNode/service/@operation = 'AccountSettings'">
|
---|
146 | <form method="POST">
|
---|
147 | <xsl:attribute name="action">
|
---|
148 | <xsl:choose>
|
---|
149 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'EditUser'">
|
---|
150 | <xsl:value-of select="$library_name"/><xsl:text>/admin/PerformEdit</xsl:text>
|
---|
151 | </xsl:when>
|
---|
152 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'AccountSettings'">
|
---|
153 | <xsl:value-of select="$library_name"/><xsl:text>/admin/PerformAccEdit</xsl:text>
|
---|
154 | </xsl:when>
|
---|
155 | </xsl:choose>
|
---|
156 | </xsl:attribute>
|
---|
157 | <input type="hidden" name="s1.prevUsername" value="{/page/pageResponse/authenticationNode/service/userNodeList/userNode/@username}"/>
|
---|
158 | <table>
|
---|
159 | <tr>
|
---|
160 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/><xsl:text>: </xsl:text></td>
|
---|
161 | <td>
|
---|
162 | <input type="text" name="s1.newUsername" value="{/page/pageResponse/authenticationNode/service/userNodeList/userNode/@username}"/>
|
---|
163 | </td>
|
---|
164 | </tr>
|
---|
165 | <tr>
|
---|
166 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.email')"/><xsl:text>: </xsl:text></td>
|
---|
167 | <td>
|
---|
168 | <input type="text" name="s1.newEmail" value="{/page/pageResponse/authenticationNode/service/userNodeList/userNode/@email}"/>
|
---|
169 | </td>
|
---|
170 | </tr>
|
---|
171 | <xsl:choose>
|
---|
172 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'EditUser'">
|
---|
173 | <tr>
|
---|
174 | <td id="passwordLabelCell">
|
---|
175 | <button id="changePasswordButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password')"/>...</button>
|
---|
176 | <script type="text/javascript">
|
---|
177 | <xsl:text disable-output-escaping="yes">
|
---|
178 | var passwordLabelText = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password')"/><xsl:text disable-output-escaping="yes">";
|
---|
179 | var changePasswordButton = document.getElementById("changePasswordButton");
|
---|
180 | changePasswordButton.onclick = function()
|
---|
181 | {
|
---|
182 | changePasswordButton.parentNode.removeChild(changePasswordButton);
|
---|
183 |
|
---|
184 | var passwordLabel = document.createTextNode(passwordLabelText + ": ");
|
---|
185 | document.getElementById("passwordLabelCell").appendChild(passwordLabel);
|
---|
186 |
|
---|
187 | var passwordInput = document.createElement("INPUT");
|
---|
188 | passwordInput.setAttribute("name", "s1.password");
|
---|
189 | passwordInput.setAttribute("type", "password");
|
---|
190 | document.getElementById("passwordInputCell").appendChild(passwordInput);
|
---|
191 | }
|
---|
192 | </xsl:text>
|
---|
193 | </script>
|
---|
194 | </td>
|
---|
195 | <td id="passwordInputCell">
|
---|
196 | <xsl:text> </xsl:text>
|
---|
197 | </td>
|
---|
198 | </tr>
|
---|
199 | </xsl:when>
|
---|
200 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'AccountSettings'">
|
---|
201 | <tr>
|
---|
202 | <xsl:if test="not(/page/pageResponse/error/@type = 'Incorrect Password')">
|
---|
203 | <td><button id="changePasswordButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password')"/>...</button></td>
|
---|
204 | <script type="text/javascript">
|
---|
205 | <xsl:text disable-output-escaping="yes">
|
---|
206 | var oldPasswordLabelText = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.old_password')"/><xsl:text disable-output-escaping="yes">";
|
---|
207 | var newPasswordLabelText = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.new_password')"/><xsl:text disable-output-escaping="yes">";
|
---|
208 | var rtNewPasswordLabelText = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.retype_password')"/><xsl:text disable-output-escaping="yes">";
|
---|
209 |
|
---|
210 | var changePasswordButton = document.getElementById("changePasswordButton");
|
---|
211 | changePasswordButton.onclick = function()
|
---|
212 | {
|
---|
213 | changePasswordButton.parentNode.removeChild(changePasswordButton);
|
---|
214 |
|
---|
215 | var names = ["s1.oldPassword", "s1.newPassword", ""];
|
---|
216 | var ids = ["oldPassword", "passwordOne", "passwordTwo"];
|
---|
217 | var labels = [oldPasswordLabelText, newPasswordLabelText, rtNewPasswordLabelText];
|
---|
218 | var parents = ["oldPassword", "password", "retypePassword"];
|
---|
219 |
|
---|
220 | for(var i = 0; i < names.length; i++)
|
---|
221 | {
|
---|
222 | $("#" + parents[i] + "LabelCell").append(labels[i] + ": ");
|
---|
223 |
|
---|
224 | var input = $("<input>");
|
---|
225 | input.attr("name", names[i]);
|
---|
226 | input.attr("type", "password");
|
---|
227 | input.attr("id", ids[i]);
|
---|
228 |
|
---|
229 | $("#" + parents[i] + "InputCell").append(input);
|
---|
230 | }
|
---|
231 | }
|
---|
232 | </xsl:text>
|
---|
233 | </script>
|
---|
234 | </xsl:if>
|
---|
235 | </tr>
|
---|
236 |
|
---|
237 | <xsl:choose>
|
---|
238 | <xsl:when test="not(/page/pageResponse/error/@type = 'Incorrect Password')">
|
---|
239 | <tr>
|
---|
240 | <td id="oldPasswordLabelCell"><xsl:text> </xsl:text></td>
|
---|
241 | <td id="oldPasswordInputCell"><xsl:text> </xsl:text></td>
|
---|
242 | </tr>
|
---|
243 | <tr>
|
---|
244 | <td id="passwordLabelCell"><xsl:text> </xsl:text></td>
|
---|
245 | <td id="passwordInputCell"><xsl:text> </xsl:text></td>
|
---|
246 | </tr>
|
---|
247 | <tr>
|
---|
248 | <td id="retypePasswordLabelCell"><xsl:text> </xsl:text></td>
|
---|
249 | <td id="retypePasswordInputCell"><xsl:text> </xsl:text></td>
|
---|
250 | </tr>
|
---|
251 | </xsl:when>
|
---|
252 | <xsl:otherwise>
|
---|
253 | <tr>
|
---|
254 | <td id="oldPasswordLabelCell"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.old_password')"/></td>
|
---|
255 | <td id="oldPasswordInputCell"><input id="oldPassword" name="s1.oldPassword" type="password"/></td>
|
---|
256 | </tr>
|
---|
257 | <tr>
|
---|
258 | <td id="passwordLabelCell"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.new_password')"/></td>
|
---|
259 | <td id="passwordInputCell"><input id="passwordOne" name="s1.newPassword" type="password"/></td>
|
---|
260 | </tr>
|
---|
261 | <tr>
|
---|
262 | <td id="retypePasswordLabelCell"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.retype_password')"/></td>
|
---|
263 | <td id="retypePasswordInputCell"><input id="passwordTwo" type="password"/></td>
|
---|
264 | </tr>
|
---|
265 | </xsl:otherwise>
|
---|
266 | </xsl:choose>
|
---|
267 | </xsl:when>
|
---|
268 | </xsl:choose>
|
---|
269 | <xsl:if test="/page/pageResponse/authenticationNode/service/@operation = 'EditUser'">
|
---|
270 | <tr>
|
---|
271 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups')"/><xsl:text>: </xsl:text></td>
|
---|
272 | <td>
|
---|
273 | <input id="groupsInput" size="50" type="text" name="s1.groups" value="{/page/pageResponse/authenticationNode/service/userNodeList/userNode/@groups}"/>
|
---|
274 | </td>
|
---|
275 | <td>
|
---|
276 | <select id="groupSelector">
|
---|
277 | <option>COLLNAME-collection-editor</option>
|
---|
278 | <option>personal-collections-editor</option>
|
---|
279 | <option>all-collections-editor</option>
|
---|
280 | <option>administrator</option>
|
---|
281 | </select>
|
---|
282 | </td>
|
---|
283 | <td>
|
---|
284 | <button id="addGroupButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_group')"/></button>
|
---|
285 | <script type="text/javascript">
|
---|
286 | <xsl:text disable-output-escaping="yes">
|
---|
287 | var addGroupButton = document.getElementById("addGroupButton");
|
---|
288 | addGroupButton.onclick = function()
|
---|
289 | {
|
---|
290 | var groupsInput = document.getElementById("groupsInput");
|
---|
291 | var groupSelector = document.getElementById("groupSelector");
|
---|
292 | var options = groupSelector.getElementsByTagName("OPTION");
|
---|
293 | var selectedGroup = options[groupSelector.selectedIndex].innerHTML;
|
---|
294 | var currentValue = groupsInput.value;
|
---|
295 |
|
---|
296 | if(currentValue && currentValue.search(/\w/) != -1)
|
---|
297 | {
|
---|
298 | groupsInput.value = currentValue + "," + selectedGroup;
|
---|
299 | }
|
---|
300 | else
|
---|
301 | {
|
---|
302 | groupsInput.value = selectedGroup;
|
---|
303 | }
|
---|
304 | return false;
|
---|
305 | }
|
---|
306 | </xsl:text>
|
---|
307 | </script>
|
---|
308 | </td>
|
---|
309 | </tr>
|
---|
310 | <tr>
|
---|
311 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/><xsl:text>: </xsl:text></td>
|
---|
312 | <td>
|
---|
313 | <textarea name="s1.comment" style="width:100%;"><xsl:value-of select="/page/pageResponse/authenticationNode/service/userNodeList/userNode/@comment"/></textarea>
|
---|
314 | </td>
|
---|
315 | </tr>
|
---|
316 | <tr>
|
---|
317 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.status')"/><xsl:text>: </xsl:text></td>
|
---|
318 | <td>
|
---|
319 | <input type="radio" name="s1.status" value="true">
|
---|
320 | <xsl:if test="/page/pageResponse/authenticationNode/service/userNodeList/userNode/@status = 'true'">
|
---|
321 | <xsl:attribute name="checked">true</xsl:attribute>
|
---|
322 | </xsl:if>
|
---|
323 | </input>
|
---|
324 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/><xsl:text> </xsl:text>
|
---|
325 |
|
---|
326 | <input type="radio" name="s1.status" value="false">
|
---|
327 | <xsl:if test="/page/pageResponse/authenticationNode/service/userNodeList/userNode/@status = 'false'">
|
---|
328 | <xsl:attribute name="checked">true</xsl:attribute>
|
---|
329 | </xsl:if>
|
---|
330 | </input>
|
---|
331 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/><xsl:text> </xsl:text>
|
---|
332 | </td>
|
---|
333 | </tr>
|
---|
334 | </xsl:if>
|
---|
335 | <tr>
|
---|
336 | <td>
|
---|
337 | <input id="submitButton" type="submit" value="{util:getInterfaceText($interface_name, /page/@lang, 'authen.submit')}"/>
|
---|
338 | <xsl:if test="/page/pageResponse/authenticationNode/service/@operation = 'AccountSettings'">
|
---|
339 | <script type="text/javascript">
|
---|
340 | <xsl:text disable-output-escaping="yes">
|
---|
341 | $("#submitButton").click(function()
|
---|
342 | {
|
---|
343 | var passwordOne = $("#passwordOne");
|
---|
344 | var passwordTwo = $("#passwordTwo");
|
---|
345 |
|
---|
346 | if(passwordOne.val() != passwordTwo.val())
|
---|
347 | {
|
---|
348 | alert("The passwords you have entered do not match");
|
---|
349 | return false;
|
---|
350 | }
|
---|
351 | else
|
---|
352 | {
|
---|
353 | return true;
|
---|
354 | }
|
---|
355 | });
|
---|
356 | </xsl:text>
|
---|
357 | </script>
|
---|
358 | </xsl:if>
|
---|
359 | </td>
|
---|
360 | </tr>
|
---|
361 | <!--<tr>
|
---|
362 | <td style="font-size:0.6em;"><a href="{$library_name}/admin/PerformResetPassword?s1.username={/page/pageResponse/authenticationNode/service/userNodeList/userNode/@username}"><br/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.reset_password')"/>...</a></td>
|
---|
363 | </tr>-->
|
---|
364 | </table>
|
---|
365 | </form>
|
---|
366 | </xsl:when>
|
---|
367 |
|
---|
368 | <!-- ************************ -->
|
---|
369 | <!-- ADD USER / REGISTER PAGE -->
|
---|
370 | <!-- ************************ -->
|
---|
371 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'AddUser' or /page/pageResponse/authenticationNode/service/@operation = 'Register'">
|
---|
372 | <div id="errorArea"><xsl:text> </xsl:text></div>
|
---|
373 | <form method="POST">
|
---|
374 | <xsl:attribute name="action">
|
---|
375 | <xsl:choose>
|
---|
376 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'AddUser'">
|
---|
377 | <xsl:value-of select="$library_name"/><xsl:text>/admin/PerformAdd</xsl:text>
|
---|
378 | </xsl:when>
|
---|
379 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'Register'">
|
---|
380 | <xsl:value-of select="$library_name"/><xsl:text>/admin/PerformRegister</xsl:text>
|
---|
381 | </xsl:when>
|
---|
382 | </xsl:choose>
|
---|
383 | </xsl:attribute>
|
---|
384 | <table>
|
---|
385 | <tr>
|
---|
386 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/><xsl:text>: </xsl:text></td>
|
---|
387 | <td>
|
---|
388 | <input type="text" name="s1.username"/>
|
---|
389 | </td>
|
---|
390 | </tr>
|
---|
391 | <tr>
|
---|
392 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password')"/><xsl:text>: </xsl:text></td>
|
---|
393 | <td>
|
---|
394 | <input id="passwordOne" type="password" name="s1.password"/>
|
---|
395 | </td>
|
---|
396 | </tr>
|
---|
397 | <tr>
|
---|
398 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.retype_password')"/><xsl:text>: </xsl:text></td>
|
---|
399 | <td>
|
---|
400 | <input id="passwordTwo" type="password"/>
|
---|
401 | </td>
|
---|
402 | </tr>
|
---|
403 | <tr>
|
---|
404 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.email')"/><xsl:text>: </xsl:text></td>
|
---|
405 | <td>
|
---|
406 | <input type="text" name="s1.email"/>
|
---|
407 | </td>
|
---|
408 | </tr>
|
---|
409 | <xsl:if test="/page/pageResponse/authenticationNode/service/@operation = 'AddUser'">
|
---|
410 | <tr>
|
---|
411 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups')"/><xsl:text>: </xsl:text></td>
|
---|
412 | <td>
|
---|
413 | <input id="groupsInput" size="50" type="text" name="s1.groups"/>
|
---|
414 | </td>
|
---|
415 | <td>
|
---|
416 | <select id="groupSelector">
|
---|
417 | <option>personal-collections-editor</option>
|
---|
418 | <option>all-collections-editor</option>
|
---|
419 | <option>administrator</option>
|
---|
420 | </select>
|
---|
421 | </td>
|
---|
422 | <td>
|
---|
423 | <button id="addGroupButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_group')"/></button>
|
---|
424 | <script type="text/javascript">
|
---|
425 | <xsl:text disable-output-escaping="yes">
|
---|
426 | var addGroupButton = document.getElementById("addGroupButton");
|
---|
427 | addGroupButton.onclick = function()
|
---|
428 | {
|
---|
429 | var groupsInput = document.getElementById("groupsInput");
|
---|
430 | var groupSelector = document.getElementById("groupSelector");
|
---|
431 | var options = groupSelector.getElementsByTagName("OPTION");
|
---|
432 | var selectedGroup = options[groupSelector.selectedIndex].innerHTML;
|
---|
433 | var currentValue = groupsInput.value;
|
---|
434 |
|
---|
435 | if(currentValue && currentValue.search(/\w/) != -1)
|
---|
436 | {
|
---|
437 | groupsInput.value = currentValue + "," + selectedGroup;
|
---|
438 | }
|
---|
439 | else
|
---|
440 | {
|
---|
441 | groupsInput.value = selectedGroup;
|
---|
442 | }
|
---|
443 | return false;
|
---|
444 | }
|
---|
445 | </xsl:text>
|
---|
446 | </script>
|
---|
447 | </td>
|
---|
448 | </tr>
|
---|
449 | <tr>
|
---|
450 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/><xsl:text>: </xsl:text></td>
|
---|
451 | <td>
|
---|
452 | <textarea name="s1.comment" style="width:100%;"><xsl:text> </xsl:text></textarea>
|
---|
453 | </td>
|
---|
454 | </tr>
|
---|
455 | <tr>
|
---|
456 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.status')"/><xsl:text>: </xsl:text></td>
|
---|
457 | <td>
|
---|
458 | <input type="radio" name="s1.status" value="true" checked="true"/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/><xsl:text> </xsl:text>
|
---|
459 | <input type="radio" name="s1.status" value="false"/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/><xsl:text> </xsl:text>
|
---|
460 | </td>
|
---|
461 | </tr>
|
---|
462 | </xsl:if>
|
---|
463 | <xsl:if test="/page/pageResponse/authenticationNode/service/@operation = 'Register' and /page/pageResponse/recaptcha/@privateKey and /page/pageResponse/recaptcha/@publicKey">
|
---|
464 | <tr>
|
---|
465 | <td colspan="2" id="recaptchaArea">
|
---|
466 | <xsl:value-of disable-output-escaping="yes" select="util:reCAPTCHAimage(/page/pageResponse/recaptcha/@publicKey, /page/pageResponse/recaptcha/@privateKey)"/>
|
---|
467 | </td>
|
---|
468 | <script type="text/javascript">
|
---|
469 | <xsl:text disable-output-escaping="yes">
|
---|
470 | function changeParams()
|
---|
471 | {
|
---|
472 | $("#recaptcha_challenge_field").attr("name", "s1.recaptcha_challenge_field");
|
---|
473 | $("#recaptcha_response_field").attr("name", "s1.recaptcha_response_field");
|
---|
474 | }
|
---|
475 | $(window).load(changeParams);
|
---|
476 |
|
---|
477 | function checkreCaptchaError()
|
---|
478 | {
|
---|
479 | var html = $("#recaptchaArea").html();
|
---|
480 | if(html.search(/Invalid referer/g) != -1)
|
---|
481 | {
|
---|
482 | $("#recaptchaArea").html("");
|
---|
483 | $("#errorArea").html("The reCAPTCHA key used in the siteconfig.xml file for this site is invalid for this domain name. Please contact your collection administrator.");
|
---|
484 | $("#errorArea").attr("class", "ui-state-error ui-corner-all");
|
---|
485 | }
|
---|
486 | }
|
---|
487 | $(window).load(checkreCaptchaError);
|
---|
488 | </xsl:text>
|
---|
489 | </script>
|
---|
490 | </tr>
|
---|
491 | </xsl:if>
|
---|
492 | <tr>
|
---|
493 | <td>
|
---|
494 | <input id="submitButton" type="submit" value="{util:getInterfaceText($interface_name, /page/@lang, 'authen.submit')}"/>
|
---|
495 | <script type="text/javascript">
|
---|
496 | <xsl:text disable-output-escaping="yes">
|
---|
497 | $("#submitButton").click(function()
|
---|
498 | {
|
---|
499 | var passwordOne = $("#passwordOne");
|
---|
500 | var passwordTwo = $("#passwordTwo");
|
---|
501 |
|
---|
502 | if(passwordOne.val() != passwordTwo.val())
|
---|
503 | {
|
---|
504 | alert("The passwords you have entered do not match");
|
---|
505 | return false;
|
---|
506 | }
|
---|
507 | else
|
---|
508 | {
|
---|
509 | return true;
|
---|
510 | }
|
---|
511 | });
|
---|
512 | </xsl:text>
|
---|
513 | </script>
|
---|
514 | </td>
|
---|
515 | </tr>
|
---|
516 | </table>
|
---|
517 | </form>
|
---|
518 | </xsl:when>
|
---|
519 |
|
---|
520 | <!-- ********************** -->
|
---|
521 | <!-- REGISTER RESPONSE PAGE -->
|
---|
522 | <!-- ********************** -->
|
---|
523 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'PerformRegister'">
|
---|
524 | <xsl:choose>
|
---|
525 | <xsl:when test="/page/pageResponse/error">
|
---|
526 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.error_failed_to_add')"/>
|
---|
527 | </xsl:when>
|
---|
528 | <xsl:otherwise>
|
---|
529 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.user_added_success')"/>
|
---|
530 | <meta http-equiv="refresh" content="2; url={/page/pageRequest/@baseURL}{$library_name}"/>
|
---|
531 | </xsl:otherwise>
|
---|
532 | </xsl:choose>
|
---|
533 | </xsl:when>
|
---|
534 |
|
---|
535 | <xsl:otherwise>
|
---|
536 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.page_not_found')"/>
|
---|
537 | </xsl:otherwise>
|
---|
538 | </xsl:choose>
|
---|
539 | </div>
|
---|
540 | </xsl:template>
|
---|
541 |
|
---|
542 | </xsl:stylesheet> |
---|