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