mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 02:46:40 +02:00
Merge branch 'MDL-53368-master-3' of https://github.com/HuongNV13/moodle
This commit is contained in:
commit
29ec472284
11 changed files with 157 additions and 6 deletions
|
@ -73,6 +73,8 @@ class login implements renderable, templatable {
|
|||
public $logintoken;
|
||||
/** @var string Maintenance message, if Maintenance is enabled. */
|
||||
public $maintenance;
|
||||
/** @var string ReCaptcha element HTML. */
|
||||
public $recaptcha;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
@ -122,6 +124,12 @@ class login implements renderable, templatable {
|
|||
// Identity providers.
|
||||
$this->identityproviders = \auth_plugin_base::get_identity_providers($authsequence);
|
||||
$this->logintoken = \core\session\manager::get_login_token();
|
||||
|
||||
// ReCaptcha.
|
||||
if (login_captcha_enabled()) {
|
||||
require_once($CFG->libdir . '/recaptchalib_v2.php');
|
||||
$this->recaptcha = recaptcha_get_challenge_html(RECAPTCHA_API_URL, $CFG->recaptchapublickey);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -166,6 +174,7 @@ class login implements renderable, templatable {
|
|||
$data->logintoken = $this->logintoken;
|
||||
$data->maintenance = format_text($this->maintenance, FORMAT_MOODLE);
|
||||
$data->languagemenu = $this->languagemenu;
|
||||
$data->recaptcha = $this->recaptcha;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue