From 0efca3894101598ba271a6495b25afc64bf8c968 Mon Sep 17 00:00:00 2001 From: Felipe Carasso Date: Tue, 23 Jul 2019 22:38:25 -0400 Subject: [PATCH] fix(ISSUE-29): repairs config reference for Captcha after Auth API migration --- auth.php | 29 +---------------------------- version.php | 4 ++-- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/auth.php b/auth.php index 5cd7980..f1c0f73 100644 --- a/auth.php +++ b/auth.php @@ -229,39 +229,12 @@ public function config_form($config, $err, $user_fields) { include("config.html"); } - /** - * Processes and stores configuration data for this authentication plugin. - */ - public function process_config($config) { - // Set to defaults if undefined. - if (!isset($config->recaptcha)) { - $config->recaptcha = false; - } - - /* - * -1: First admin user found (default) - * -2: All admin users - * >=0: Specific user id - */ - if (!isset($config->notif_strategy) || !is_numeric($config->notif_strategy) || $config->notif_strategy < -2) { - $config->notif_strategy = -1; // Default: first admin user found. - } - - // Save settings. - set_config('recaptcha', $config->recaptcha, 'auth/emailadmin'); - set_config('notif_strategy', $config->notif_strategy, 'auth/emailadmin'); - return true; - } - /** * Returns whether or not the captcha element is enabled, and the admin settings fulfil its requirements. * @return bool */ public function is_captcha_enabled() { - global $CFG; - return isset($CFG->recaptchapublickey) && - isset($CFG->recaptchaprivatekey) && - get_config("auth/{$this->authtype}", 'recaptcha'); + return get_config("auth_{$this->authtype}", 'recaptcha'); } /** diff --git a/version.php b/version.php index 9492ae8..4d948c8 100644 --- a/version.php +++ b/version.php @@ -26,8 +26,8 @@ defined('MOODLE_INTERNAL') || die; -$plugin->version = 2019070802; // The current plugin version (Date: YYYYMMDDXX). +$plugin->version = 2019072300; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2015051101; // Requires this Moodle version. $plugin->component = 'auth_emailadmin'; // Full name of the plugin (used for diagnostics). $plugin->maturity = MATURITY_STABLE; -$plugin->release = '1.4.3'; +$plugin->release = '1.4.4';