Merge remote-tracking branch 'origin/pull/13011'
This commit is contained in:
commit
a280edc69f
@ -5022,6 +5022,34 @@ function toggleDatepickerIfInvalid($td, $input_field) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Function to enable the 'Go' button on login.
|
||||
*/
|
||||
function login_go_button_enable() {
|
||||
$('#input_go').prop('disabled', false);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function to disable the 'Go' button on login.
|
||||
*/
|
||||
function login_go_button_disable() {
|
||||
$('#input_go').prop('disabled', true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Setting the 'Go' login button to disable if captcha is enabled.
|
||||
*/
|
||||
$(function ()
|
||||
{
|
||||
|
||||
var captcha = $('.g-recaptcha').attr('captcha');
|
||||
|
||||
if(captcha=='enabled'){
|
||||
login_go_button_disable();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
|
||||
@ -228,7 +228,8 @@ class AuthenticationCookie extends AuthenticationPlugin
|
||||
echo '<script src="https://www.google.com/recaptcha/api.js?hl='
|
||||
, $GLOBALS['lang'] , '" async defer></script>';
|
||||
echo '<div class="g-recaptcha" data-sitekey="'
|
||||
, htmlspecialchars($GLOBALS['cfg']['CaptchaLoginPublicKey']) , '"></div>';
|
||||
, htmlspecialchars($GLOBALS['cfg']['CaptchaLoginPublicKey']) ,
|
||||
'" data-callback="login_go_button_enable" data-expired-callback="login_go_button_disable" captcha="enabled"></div>';
|
||||
}
|
||||
|
||||
echo '</fieldset>
|
||||
|
||||
@ -334,7 +334,7 @@ class AuthenticationCookieTest extends PMATestCase
|
||||
);
|
||||
|
||||
$this->assertContains(
|
||||
'<div class="g-recaptcha" data-sitekey="testpubkey">',
|
||||
'<div class="g-recaptcha" data-sitekey="testpubkey" data-callback="login_go_button_enable" data-expired-callback="login_go_button_disable" captcha="enabled">',
|
||||
$result
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user