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