[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'">
|
---|
| 192 | <tr>
|
---|
[25292] | 193 | <td><button id="changePasswordButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password')"/>...</button></td>
|
---|
[25275] | 194 | <script type="text/javascript">
|
---|
| 195 | <xsl:text disable-output-escaping="yes">
|
---|
[25292] | 196 | var oldPasswordLabelText = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.old_password')"/><xsl:text disable-output-escaping="yes">";
|
---|
| 197 | var newPasswordLabelText = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.new_password')"/><xsl:text disable-output-escaping="yes">";
|
---|
| 198 | var rtNewPasswordLabelText = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.retype_password')"/><xsl:text disable-output-escaping="yes">";
|
---|
| 199 |
|
---|
[25275] | 200 | var changePasswordButton = document.getElementById("changePasswordButton");
|
---|
| 201 | changePasswordButton.onclick = function()
|
---|
| 202 | {
|
---|
| 203 | changePasswordButton.parentNode.removeChild(changePasswordButton);
|
---|
| 204 |
|
---|
| 205 | var names = ["s1.oldPassword", "s1.newPassword", ""];
|
---|
| 206 | var ids = ["oldPassword", "passwordOne", "passwordTwo"];
|
---|
[25292] | 207 | var labels = [oldPasswordLabelText, newPasswordLabelText, rtNewPasswordLabelText];
|
---|
[25275] | 208 | var parents = ["oldPassword", "password", "retypePassword"];
|
---|
| 209 |
|
---|
| 210 | for(var i = 0; i < names.length; i++)
|
---|
| 211 | {
|
---|
[25292] | 212 | $("#" + parents[i] + "LabelCell").append(labels[i] + ": ");
|
---|
[25275] | 213 |
|
---|
| 214 | var input = $("<input>");
|
---|
| 215 | input.attr("name", names[i]);
|
---|
| 216 | input.attr("type", "password");
|
---|
| 217 | input.attr("id", ids[i]);
|
---|
| 218 |
|
---|
| 219 | $("#" + parents[i] + "InputCell").append(input);
|
---|
| 220 | }
|
---|
| 221 | }
|
---|
| 222 | </xsl:text>
|
---|
| 223 | </script>
|
---|
| 224 | </tr>
|
---|
| 225 | <tr>
|
---|
| 226 | <td id="oldPasswordLabelCell"><xsl:text> </xsl:text></td>
|
---|
| 227 | <td id="oldPasswordInputCell"><xsl:text> </xsl:text></td>
|
---|
| 228 | </tr>
|
---|
| 229 | <tr>
|
---|
| 230 | <td id="passwordLabelCell"><xsl:text> </xsl:text></td>
|
---|
| 231 | <td id="passwordInputCell"><xsl:text> </xsl:text></td>
|
---|
| 232 | </tr>
|
---|
| 233 | <tr>
|
---|
| 234 | <td id="retypePasswordLabelCell"><xsl:text> </xsl:text></td>
|
---|
| 235 | <td id="retypePasswordInputCell"><xsl:text> </xsl:text></td>
|
---|
| 236 | </tr>
|
---|
| 237 | </xsl:when>
|
---|
| 238 | </xsl:choose>
|
---|
| 239 | <xsl:if test="/page/pageResponse/authenticationNode/service/@operation = 'EditUser'">
|
---|
| 240 | <tr>
|
---|
[25292] | 241 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups')"/><xsl:text>: </xsl:text></td>
|
---|
[25275] | 242 | <td>
|
---|
| 243 | <input id="groupsInput" size="50" type="text" name="s1.groups" value="{/page/pageResponse/authenticationNode/service/userNodeList/userNode/@groups}"/>
|
---|
| 244 | </td>
|
---|
| 245 | <td>
|
---|
| 246 | <select id="groupSelector">
|
---|
| 247 | <option>administrator</option>
|
---|
| 248 | <option>all-collections-editor</option>
|
---|
| 249 | <option>personal-collections-editor</option>
|
---|
| 250 | </select>
|
---|
| 251 | </td>
|
---|
| 252 | <td>
|
---|
[25292] | 253 | <button id="addGroupButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_group')"/></button>
|
---|
[25275] | 254 | <script type="text/javascript">
|
---|
| 255 | <xsl:text disable-output-escaping="yes">
|
---|
| 256 | var addGroupButton = document.getElementById("addGroupButton");
|
---|
| 257 | addGroupButton.onclick = function()
|
---|
| 258 | {
|
---|
| 259 | var groupsInput = document.getElementById("groupsInput");
|
---|
| 260 | var groupSelector = document.getElementById("groupSelector");
|
---|
| 261 | var options = groupSelector.getElementsByTagName("OPTION");
|
---|
| 262 | var selectedGroup = options[groupSelector.selectedIndex].innerHTML;
|
---|
| 263 | var currentValue = groupsInput.value;
|
---|
| 264 |
|
---|
| 265 | if(currentValue && currentValue.search(/\w/) != -1)
|
---|
| 266 | {
|
---|
| 267 | groupsInput.value = currentValue + "," + selectedGroup;
|
---|
| 268 | }
|
---|
| 269 | else
|
---|
| 270 | {
|
---|
| 271 | groupsInput.value = selectedGroup;
|
---|
| 272 | }
|
---|
| 273 | return false;
|
---|
| 274 | }
|
---|
| 275 | </xsl:text>
|
---|
| 276 | </script>
|
---|
| 277 | </td>
|
---|
| 278 | </tr>
|
---|
| 279 | <tr>
|
---|
[25292] | 280 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/><xsl:text>: </xsl:text></td>
|
---|
[25275] | 281 | <td>
|
---|
| 282 | <textarea name="s1.comment" style="width:100%;"><xsl:value-of select="/page/pageResponse/authenticationNode/service/userNodeList/userNode/@comment"/></textarea>
|
---|
| 283 | </td>
|
---|
| 284 | </tr>
|
---|
| 285 | <tr>
|
---|
[25292] | 286 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.status')"/><xsl:text>: </xsl:text></td>
|
---|
[25275] | 287 | <td>
|
---|
| 288 | <input type="radio" name="s1.status" value="true">
|
---|
| 289 | <xsl:if test="/page/pageResponse/authenticationNode/service/userNodeList/userNode/@status = 'true'">
|
---|
| 290 | <xsl:attribute name="checked">true</xsl:attribute>
|
---|
| 291 | </xsl:if>
|
---|
| 292 | </input>
|
---|
[25292] | 293 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/><xsl:text> </xsl:text>
|
---|
[25275] | 294 |
|
---|
| 295 | <input type="radio" name="s1.status" value="false">
|
---|
| 296 | <xsl:if test="/page/pageResponse/authenticationNode/service/userNodeList/userNode/@status = 'false'">
|
---|
| 297 | <xsl:attribute name="checked">true</xsl:attribute>
|
---|
| 298 | </xsl:if>
|
---|
| 299 | </input>
|
---|
[25292] | 300 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/><xsl:text> </xsl:text>
|
---|
[25275] | 301 | </td>
|
---|
| 302 | </tr>
|
---|
| 303 | </xsl:if>
|
---|
| 304 | <tr>
|
---|
| 305 | <td>
|
---|
[25292] | 306 | <input id="submitButton" type="submit" value="{util:getInterfaceText($interface_name, /page/@lang, 'authen.submit')}"/>
|
---|
[25275] | 307 | <xsl:if test="/page/pageResponse/authenticationNode/service/@operation = 'AccountSettings'">
|
---|
| 308 | <script type="text/javascript">
|
---|
| 309 | <xsl:text disable-output-escaping="yes">
|
---|
| 310 | $("#submitButton").click(function()
|
---|
| 311 | {
|
---|
| 312 | var passwordOne = $("#passwordOne");
|
---|
| 313 | var passwordTwo = $("#passwordTwo");
|
---|
| 314 |
|
---|
| 315 | if(passwordOne.val() != passwordTwo.val())
|
---|
| 316 | {
|
---|
| 317 | alert("The passwords you have entered do not match");
|
---|
| 318 | return false;
|
---|
| 319 | }
|
---|
| 320 | else
|
---|
| 321 | {
|
---|
| 322 | return true;
|
---|
| 323 | }
|
---|
| 324 | });
|
---|
| 325 | </xsl:text>
|
---|
| 326 | </script>
|
---|
| 327 | </xsl:if>
|
---|
| 328 | </td>
|
---|
| 329 | </tr>
|
---|
| 330 | <tr>
|
---|
[25292] | 331 | <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] | 332 | </tr>
|
---|
| 333 | </table>
|
---|
| 334 | </form>
|
---|
| 335 | </xsl:when>
|
---|
| 336 |
|
---|
| 337 | <!-- ************************ -->
|
---|
| 338 | <!-- ADD USER / REGISTER PAGE -->
|
---|
| 339 | <!-- ************************ -->
|
---|
| 340 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'AddUser' or /page/pageResponse/authenticationNode/service/@operation = 'Register'">
|
---|
| 341 | <form method="POST">
|
---|
| 342 | <xsl:attribute name="action">
|
---|
| 343 | <xsl:choose>
|
---|
| 344 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'AddUser'">
|
---|
| 345 | <xsl:value-of select="$library_name"/><xsl:text>/admin/PerformAdd</xsl:text>
|
---|
| 346 | </xsl:when>
|
---|
| 347 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'Register'">
|
---|
| 348 | <xsl:value-of select="$library_name"/><xsl:text>/admin/PerformRegister</xsl:text>
|
---|
| 349 | </xsl:when>
|
---|
| 350 | </xsl:choose>
|
---|
| 351 | </xsl:attribute>
|
---|
| 352 | <table>
|
---|
| 353 | <tr>
|
---|
[25292] | 354 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/><xsl:text>: </xsl:text></td>
|
---|
[25275] | 355 | <td>
|
---|
| 356 | <input type="text" name="s1.username"/>
|
---|
| 357 | </td>
|
---|
| 358 | </tr>
|
---|
| 359 | <tr>
|
---|
[25292] | 360 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password')"/><xsl:text>: </xsl:text></td>
|
---|
[25275] | 361 | <td>
|
---|
| 362 | <input id="passwordOne" type="password" name="s1.password"/>
|
---|
| 363 | </td>
|
---|
| 364 | </tr>
|
---|
| 365 | <tr>
|
---|
[25292] | 366 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.retype_password')"/><xsl:text>: </xsl:text></td>
|
---|
[25275] | 367 | <td>
|
---|
| 368 | <input id="passwordTwo" type="password"/>
|
---|
| 369 | </td>
|
---|
| 370 | </tr>
|
---|
| 371 | <tr>
|
---|
[25292] | 372 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.email')"/><xsl:text>: </xsl:text></td>
|
---|
[25275] | 373 | <td>
|
---|
| 374 | <input type="text" name="s1.email"/>
|
---|
| 375 | </td>
|
---|
| 376 | </tr>
|
---|
| 377 | <xsl:if test="/page/pageResponse/authenticationNode/service/@operation = 'AddUser'">
|
---|
| 378 | <tr>
|
---|
[25292] | 379 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups')"/><xsl:text>: </xsl:text></td>
|
---|
[25275] | 380 | <td>
|
---|
| 381 | <input id="groupsInput" size="50" type="text" name="s1.groups"/>
|
---|
| 382 | </td>
|
---|
| 383 | <td>
|
---|
| 384 | <select id="groupSelector">
|
---|
| 385 | <option>administrator</option>
|
---|
| 386 | <option>all-collections-editor</option>
|
---|
| 387 | <option>personal-collections-editor</option>
|
---|
| 388 | </select>
|
---|
| 389 | </td>
|
---|
| 390 | <td>
|
---|
[25292] | 391 | <button id="addGroupButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_group')"/></button>
|
---|
[25275] | 392 | <script type="text/javascript">
|
---|
| 393 | <xsl:text disable-output-escaping="yes">
|
---|
| 394 | var addGroupButton = document.getElementById("addGroupButton");
|
---|
| 395 | addGroupButton.onclick = function()
|
---|
| 396 | {
|
---|
| 397 | var groupsInput = document.getElementById("groupsInput");
|
---|
| 398 | var groupSelector = document.getElementById("groupSelector");
|
---|
| 399 | var options = groupSelector.getElementsByTagName("OPTION");
|
---|
| 400 | var selectedGroup = options[groupSelector.selectedIndex].innerHTML;
|
---|
| 401 | var currentValue = groupsInput.getAttribute("value");
|
---|
| 402 |
|
---|
| 403 | if(currentValue && currentValue.search(/\w/) != -1)
|
---|
| 404 | {
|
---|
| 405 | groupsInput.setAttribute("value", currentValue + "," + selectedGroup);
|
---|
| 406 | }
|
---|
| 407 | else
|
---|
| 408 | {
|
---|
| 409 | groupsInput.setAttribute("value", selectedGroup);
|
---|
| 410 | }
|
---|
| 411 | return false;
|
---|
| 412 | }
|
---|
| 413 | </xsl:text>
|
---|
| 414 | </script>
|
---|
| 415 | </td>
|
---|
| 416 | </tr>
|
---|
| 417 | <tr>
|
---|
[25292] | 418 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/><xsl:text>: </xsl:text></td>
|
---|
[25275] | 419 | <td>
|
---|
| 420 | <textarea name="s1.comment" style="width:100%;"><xsl:text> </xsl:text></textarea>
|
---|
| 421 | </td>
|
---|
| 422 | </tr>
|
---|
| 423 | <tr>
|
---|
[25292] | 424 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.status')"/><xsl:text>: </xsl:text></td>
|
---|
[25275] | 425 | <td>
|
---|
[25292] | 426 | <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>
|
---|
| 427 | <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] | 428 | </td>
|
---|
| 429 | </tr>
|
---|
| 430 | </xsl:if>
|
---|
[25315] | 431 | <xsl:if test="/page/pageResponse/authenticationNode/service/@operation = 'Register' and /page/pageResponse/recaptcha/@privateKey and /page/pageResponse/recaptcha/@publicKey">
|
---|
[25275] | 432 | <tr>
|
---|
| 433 | <td colspan="2">
|
---|
[25315] | 434 | <xsl:value-of disable-output-escaping="yes" select="util:reCAPTCHAimage(/page/pageResponse/recaptcha/@publicKey, /page/pageResponse/recaptcha/@privateKey)"/>
|
---|
[25275] | 435 | </td>
|
---|
| 436 | <script type="text/javascript">
|
---|
| 437 | <xsl:text disable-output-escaping="yes">
|
---|
| 438 | function changeParams()
|
---|
| 439 | {
|
---|
| 440 | $("#recaptcha_challenge_field").attr("name", "s1.recaptcha_challenge_field");
|
---|
| 441 | $("#recaptcha_response_field").attr("name", "s1.recaptcha_response_field");
|
---|
| 442 | }
|
---|
| 443 | $(window).load(changeParams());
|
---|
| 444 | </xsl:text>
|
---|
| 445 | </script>
|
---|
| 446 | </tr>
|
---|
| 447 | </xsl:if>
|
---|
| 448 | <tr>
|
---|
| 449 | <td>
|
---|
[25292] | 450 | <input id="submitButton" type="submit" value="{util:getInterfaceText($interface_name, /page/@lang, 'authen.submit')}"/>
|
---|
[25275] | 451 | <script type="text/javascript">
|
---|
| 452 | <xsl:text disable-output-escaping="yes">
|
---|
| 453 | $("#submitButton").click(function()
|
---|
| 454 | {
|
---|
| 455 | var passwordOne = $("#passwordOne");
|
---|
| 456 | var passwordTwo = $("#passwordTwo");
|
---|
| 457 |
|
---|
| 458 | if(passwordOne.val() != passwordTwo.val())
|
---|
| 459 | {
|
---|
| 460 | alert("The passwords you have entered do not match");
|
---|
| 461 | return false;
|
---|
| 462 | }
|
---|
| 463 | else
|
---|
| 464 | {
|
---|
| 465 | return true;
|
---|
| 466 | }
|
---|
| 467 | });
|
---|
| 468 | </xsl:text>
|
---|
| 469 | </script>
|
---|
| 470 | </td>
|
---|
| 471 | </tr>
|
---|
| 472 | </table>
|
---|
| 473 | </form>
|
---|
| 474 | </xsl:when>
|
---|
| 475 |
|
---|
| 476 | <!-- ********************** -->
|
---|
| 477 | <!-- REGISTER RESPONSE PAGE -->
|
---|
| 478 | <!-- ********************** -->
|
---|
| 479 | <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'PerformRegister'">
|
---|
| 480 | <xsl:choose>
|
---|
| 481 | <xsl:when test="/page/pageResponse/error">
|
---|
[25292] | 482 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.error_failed_to_add')"/>
|
---|
[25275] | 483 | </xsl:when>
|
---|
| 484 | <xsl:otherwise>
|
---|
[25292] | 485 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.user_added_success')"/>
|
---|
[25275] | 486 | <meta http-equiv="refresh" content="2; url={/page/pageRequest/@baseURL}{$library_name}"/>
|
---|
| 487 | </xsl:otherwise>
|
---|
| 488 | </xsl:choose>
|
---|
| 489 | </xsl:when>
|
---|
| 490 |
|
---|
| 491 | <xsl:otherwise>
|
---|
[25292] | 492 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.page_not_found')"/>
|
---|
[25275] | 493 | </xsl:otherwise>
|
---|
| 494 | </xsl:choose>
|
---|
| 495 | </div>
|
---|
| 496 | </xsl:template>
|
---|
| 497 |
|
---|
| 498 | </xsl:stylesheet> |
---|