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