MDL-53368 block_login: reCaptcha implementation

This commit is contained in:
Huong Nguyen
2023-08-24 15:18:34 +07:00
parent dcc351e61d
commit 9e7d90cd04
+9
View File
@@ -77,6 +77,15 @@ class block_login extends block_base {
$this->content->text .= ' class="form-control" value="" autocomplete="current-password"/>';
$this->content->text .= '</div>';
// ReCaptcha.
if (login_captcha_enabled()) {
require_once($CFG->libdir . '/recaptchalib_v2.php');
$this->content->text .= '<div class="form-group">';
$this->content->text .= recaptcha_get_challenge_html(RECAPTCHA_API_URL, $CFG->recaptchapublickey,
current_language(), true);
$this->content->text .= '</div>';
}
$this->content->text .= '<div class="form-group">';
$this->content->text .= '<input type="submit" class="btn btn-primary btn-block" value="'.get_string('login').'" />';
$this->content->text .= '</div>';