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