From 0f7f30021a5be927dc2f5e847dd6f4d17299c23c Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Wed, 16 Sep 2015 15:30:04 +0800 Subject: [PATCH] MDL-51217 auth: check if recaptcha enabled for current plugin --- auth/email/auth.php | 5 ++--- auth/upgrade.txt | 4 ++++ lib/authlib.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/auth/email/auth.php b/auth/email/auth.php index 970a16f9458..0a0827d9149 100644 --- a/auth/email/auth.php +++ b/auth/email/auth.php @@ -235,12 +235,11 @@ class auth_plugin_email extends auth_plugin_base { } /** - * Returns whether or not the captcha element is enabled, and the admin settings fulfil its requirements. + * Returns whether or not the captcha element is enabled. * @return bool */ function is_captcha_enabled() { - global $CFG; - return $this->config->recaptcha; + return get_config("auth/{$this->authtype}", 'recaptcha'); } } diff --git a/auth/upgrade.txt b/auth/upgrade.txt index d867a2423c6..0024b81aad9 100644 --- a/auth/upgrade.txt +++ b/auth/upgrade.txt @@ -1,6 +1,10 @@ This files describes API changes in /auth/* - plugins, information provided here is intended especially for developers. +=== 3.0 === + +* login_signup_form::signup_captcha_enabled() now calls is_captcha_enabled() from the current auth plugin instead of from auth_email + === 2.9 === * Do not update user->firstaccess from any auth plugin, the complete_user_login() does it automatically. diff --git a/lib/authlib.php b/lib/authlib.php index 5f6ba122937..9c17d2784ad 100644 --- a/lib/authlib.php +++ b/lib/authlib.php @@ -536,7 +536,7 @@ class auth_plugin_base { } /** - * Returns whether or not the captcha element is enabled, and the admin settings fulfil its requirements. + * Returns whether or not the captcha element is enabled. * * @abstract Implement in child classes * @return bool