diff --git a/auth/ldap/db/upgrade.php b/auth/ldap/db/upgrade.php index e40963a798c21..41f9db5dc0dd8 100644 --- a/auth/ldap/db/upgrade.php +++ b/auth/ldap/db/upgrade.php @@ -47,5 +47,13 @@ function xmldb_auth_ldap_upgrade($oldversion) { // Automatically generated Moodle v3.9.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2021052501) { + // Normalize the memberattribute_isdn plugin config. + set_config('memberattribute_isdn', + !empty(get_config('auth_ldap', 'memberattribute_isdn')), 'auth_ldap'); + + upgrade_plugin_savepoint(true, 2021052501, 'auth', 'ldap'); + } + return true; } diff --git a/auth/ldap/lang/en/auth_ldap.php b/auth/ldap/lang/en/auth_ldap.php index da0f7e9546c92..5ed9e14da9347 100644 --- a/auth/ldap/lang/en/auth_ldap.php +++ b/auth/ldap/lang/en/auth_ldap.php @@ -57,7 +57,7 @@ $string['auth_ldap_ldap_encoding_key'] = 'LDAP encoding'; $string['auth_ldap_login_settings'] = 'Login settings'; $string['auth_ldap_memberattribute'] = 'Optional: Overrides user member attribute, when users belongs to a group. Usually \'member\''; -$string['auth_ldap_memberattribute_isdn'] = 'Optional: Overrides handling of member attribute values, either 0 or 1'; +$string['auth_ldap_memberattribute_isdn'] = 'Overrides handling of member attribute values'; $string['auth_ldap_memberattribute_isdn_key'] = 'Member attribute uses dn'; $string['auth_ldap_memberattribute_key'] = 'Member attribute'; $string['auth_ldap_noconnect'] = 'LDAP-module cannot connect to server: {$a}'; diff --git a/auth/ldap/settings.php b/auth/ldap/settings.php index f9bc8d9b8f344..d72aed77ac17a 100644 --- a/auth/ldap/settings.php +++ b/auth/ldap/settings.php @@ -142,9 +142,9 @@ get_string('auth_ldap_memberattribute', 'auth_ldap'), '', PARAM_RAW)); // Member attribute uses dn. - $settings->add(new admin_setting_configtext('auth_ldap/memberattribute_isdn', + $settings->add(new admin_setting_configselect('auth_ldap/memberattribute_isdn', get_string('auth_ldap_memberattribute_isdn_key', 'auth_ldap'), - get_string('auth_ldap_memberattribute_isdn', 'auth_ldap'), '', PARAM_RAW)); + get_string('auth_ldap_memberattribute_isdn', 'auth_ldap'), 0, $yesno)); // Object class. $settings->add(new admin_setting_configtext('auth_ldap/objectclass', diff --git a/auth/ldap/version.php b/auth/ldap/version.php index 592dff5b4549a..f2a5a7d19ab02 100644 --- a/auth/ldap/version.php +++ b/auth/ldap/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2021052501; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2021052500; // Requires this Moodle version $plugin->component = 'auth_ldap'; // Full name of the plugin (used for diagnostics)