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