- Timestamp:
- 2018-08-23T14:21:01+12:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/transform/pages/authen.xsl
r31072 r32372 11 11 <xsl:import href="layouts/main.xsl"/> 12 12 <xsl:output method="html"/> 13 14 <!-- set page title --> 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 --> 15 20 <xsl:template name="pageTitle"> 16 21 <xsl:choose> … … 200 205 <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'AccountSettings'"> 201 206 <tr> 202 <xsl:if test="not(/page/pageResponse/error/@type = 'I ncorrect Password')">207 <xsl:if test="not(/page/pageResponse/error/@type = 'INCORRECT_PASSWORD')"> 203 208 <td><button id="changePasswordButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password')"/>...</button></td> 204 209 <script type="text/javascript"> … … 236 241 237 242 <xsl:choose> 238 <xsl:when test="not(/page/pageResponse/error/@type = 'I ncorrect Password')">243 <xsl:when test="not(/page/pageResponse/error/@type = 'INCORRECT_PASSWORD')"> 239 244 <tr> 240 245 <td id="oldPasswordLabelCell"><xsl:text> </xsl:text></td> … … 372 377 <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'AddUser' or /page/pageResponse/authenticationNode/service/@operation = 'Register'"> 373 378 <div id="errorArea"><xsl:text> </xsl:text></div> 374 <form method="POST" >379 <form method="POST" id="registerForm"> 375 380 <xsl:attribute name="action"> 376 381 <xsl:choose> … … 464 469 </tr> 465 470 </xsl:if> 466 <xsl:if test="/page/pageResponse/authenticationNode/service/@operation = 'Register' and /page/pageResponse/recaptcha/@privateKey and /page/pageResponse/recaptcha/@publicKey"> 467 <tr> 468 <td colspan="2" id="recaptchaArea"> 469 <xsl:value-of disable-output-escaping="yes" select="util:reCAPTCHAimage(/page/pageResponse/recaptcha/@publicKey, /page/pageResponse/recaptcha/@privateKey)"/> 470 </td> 471 <script type="text/javascript"> 472 <xsl:text disable-output-escaping="yes"> 473 function changeParams() 474 { 475 $("#recaptcha_challenge_field").attr("name", "s1.recaptcha_challenge_field"); 476 $("#recaptcha_response_field").attr("name", "s1.recaptcha_response_field"); 477 } 478 $(window).load(changeParams); 479 480 function checkreCaptchaError() 481 { 482 var html = $("#recaptchaArea").html(); 483 if(html.search(/Invalid referer/g) != -1) 484 { 485 $("#recaptchaArea").html(""); 486 $("#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."); 487 $("#errorArea").attr("class", "ui-state-error ui-corner-all"); 488 } 489 } 490 $(window).load(checkreCaptchaError); 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 491 485 </xsl:text> 492 486 </script> 493 </tr>494 </xsl:if>495 <tr>496 <td>497 487 <input id="submitButton" type="submit" value="{util:getInterfaceText($interface_name, /page/@lang, 'authen.submit')}"/> 498 <script type="text/javascript">499 <xsl:text disable-output-escaping="yes">500 $("#submitButton").click(function()501 {502 var passwordOne = $("#passwordOne");503 var passwordTwo = $("#passwordTwo");504 505 if(passwordOne.val() != passwordTwo.val())506 {507 alert("The passwords you have entered do not match");508 return false;509 }510 else511 {512 return true;513 }514 });515 </xsl:text>516 </script>517 488 </td> 518 489 </tr> … … 535 506 </xsl:choose> 536 507 </xsl:when> 537 508 509 <xsl:when test="/page/pageResponse/authenticationNode/service/@operation = 'Info'"> 510 <!-- do nothing --> 511 </xsl:when> 538 512 <xsl:otherwise> 539 513 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.page_not_found')"/>
Note:
See TracChangeset
for help on using the changeset viewer.