MDL-51217 auth: check if recaptcha enabled for current plugin
authorMarina Glancy <marina@moodle.com>
Wed, 16 Sep 2015 07:30:04 +0000 (15:30 +0800)
committerMarina Glancy <marina@moodle.com>
Wed, 16 Sep 2015 07:30:04 +0000 (15:30 +0800)
auth/email/auth.php
auth/upgrade.txt
lib/authlib.php

index 970a16f..0a0827d 100644 (file)
@@ -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');
     }
 
 }
index d867a24..0024b81 100644 (file)
@@ -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.
index 5f6ba12..9c17d27 100644 (file)
@@ -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