Skip to content

Commit

Permalink
Merge pull request #30 from hrimhari/release/1.4.3
Browse files Browse the repository at this point in the history
fix(ISSUE-29): repairs config reference for Captcha after Auth API migration
  • Loading branch information
hrimhari authored Jul 24, 2019
2 parents bb9e278 + 0efca38 commit 9ef9f7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
29 changes: 1 addition & 28 deletions auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit 9ef9f7b

Please sign in to comment.