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