From 3ee50231e76c2b3b9f1663d0e4c8dc29db86668a Mon Sep 17 00:00:00 2001 From: Stephen Bourget Date: Sun, 9 Apr 2017 17:15:33 -0400 Subject: [PATCH] MDL-58526 auth: Improve labels on field mappings --- lang/en/auth.php | 4 ++++ lib/authlib.php | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lang/en/auth.php b/lang/en/auth.php index 50d95921797..c289b3b092a 100644 --- a/lang/en/auth.php +++ b/lang/en/auth.php @@ -29,9 +29,11 @@ $string['auth_common_settings'] = 'Common settings'; $string['auth_data_mapping'] = 'Data mapping'; $string['authenticationoptions'] = 'Authentication options'; $string['auth_fieldlock'] = 'Lock value'; +$string['auth_fieldlockfield'] = 'Lock value ({$a})'; $string['auth_fieldlock_expl'] = '

Lock value: If enabled, will prevent Moodle users and admins from editing the field directly. Use this option if you are maintaining this data in the external auth system.

'; $string['auth_fieldlocks'] = 'Lock user fields'; $string['auth_fieldlocks_help'] = '

You can lock user data fields. This is useful for sites where the user data is maintained by the administrators manually by editing user records or uploading using the \'Upload users\' facility. If you are locking fields that are required by Moodle, make sure that you provide that data when creating user accounts or the accounts will be unusable.

Consider setting the lock mode to \'Unlocked if empty\' to avoid this problem.

'; +$string['auth_fieldmapping'] = 'Data mapping ({$a})'; $string['auth_changepasswordhelp'] = 'Change password help'; $string['auth_changepasswordhelp_expl'] = 'Display lost password help to users who have lost their {$a} password. This will be displayed either as well as or instead of the Change Password URL or Internal Moodle password change.'; $string['auth_changepasswordurl'] = 'Change password URL'; @@ -53,8 +55,10 @@ $string['auth_sync_suspended'] = 'When enabled, the suspended attribute will be $string['auth_sync_suspended_key'] = 'Synchronise local user suspension status'; $string['auth_sync_script'] = 'User account synchronisation'; $string['auth_updatelocal'] = 'Update local'; +$string['auth_updatelocalfield'] = 'Update local ({$a})'; $string['auth_updatelocal_expl'] = '

Update local: If enabled, the field will be updated (from external auth) every time the user logs in or there is a user synchronisation. Fields set to update locally should be locked.

'; $string['auth_updateremote'] = 'Update external'; +$string['auth_updateremotefield'] = 'Update external ({$a})'; $string['auth_updateremote_expl'] = '

Update external: If enabled, the external auth will be updated when the user record is updated. Fields should be unlocked to allow edits.

'; $string['auth_updateremote_ldap'] = '

Note: Updating external LDAP data requires that you set binddn and bindpw to a bind-user with editing privileges to all the user records. It currently does not preserve multi-valued attributes, and will remove extra values on update.

'; $string['auth_user_create'] = 'Enable user creation'; diff --git a/lib/authlib.php b/lib/authlib.php index 9f37803fb46..0d4bbd87e57 100644 --- a/lib/authlib.php +++ b/lib/authlib.php @@ -980,26 +980,26 @@ function display_auth_lock_options($settings, $auth, $userfields, $helptext, $ma // We are mapping to a remote field here. // Mapping. $settings->add(new admin_setting_configtext("auth_{$auth}/field_map_{$field}", - $fieldname, '', '', PARAM_ALPHANUMEXT, 30)); + get_string('auth_fieldmapping', 'auth', $fieldname), '', '', PARAM_ALPHANUMEXT, 30)); // Update local. $settings->add(new admin_setting_configselect("auth_{$auth}/field_updatelocal_{$field}", - get_string('auth_updatelocal', 'auth'), '', 'oncreate', $updatelocaloptions)); + get_string('auth_updatelocalfield', 'auth', $fieldname), '', 'oncreate', $updatelocaloptions)); // Update remote. if ($updateremotefields) { $settings->add(new admin_setting_configselect("auth_{$auth}/field_updateremote_{$field}", - get_string('auth_updateremote', 'auth'), '', 0, $updateextoptions)); + get_string('auth_updateremotefield', 'auth', $fieldname), '', 0, $updateextoptions)); } // Lock fields. $settings->add(new admin_setting_configselect("auth_{$auth}/field_lock_{$field}", - get_string('auth_fieldlock', 'auth'), '', 'unlocked', $lockoptions)); + get_string('auth_fieldlockfield', 'auth', $fieldname), '', 'unlocked', $lockoptions)); } else { // Lock fields Only. $settings->add(new admin_setting_configselect("auth_{$auth}/field_lock_{$field}", - get_string('auth_fieldlock', 'auth'), '', 'unlocked', $lockoptions)); + get_string('auth_fieldlockfield', 'auth', $fieldname), '', 'unlocked', $lockoptions)); } } } \ No newline at end of file