Skip to content

Commit

Permalink
MDL-58526 auth: Improve labels on field mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
sbourget committed Apr 9, 2017
1 parent bd99cb9 commit 3ee5023
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions lang/en/auth.php
Expand Up @@ -29,9 +29,11 @@
$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'] = '<p><b>Lock value:</b> 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. </p>';
$string['auth_fieldlocks'] = 'Lock user fields';
$string['auth_fieldlocks_help'] = '<p>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.</p><p>Consider setting the lock mode to \'Unlocked if empty\' to avoid this problem.</p>';
$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 <strong>Change Password URL</strong> or Internal Moodle password change.';
$string['auth_changepasswordurl'] = 'Change password URL';
Expand All @@ -53,8 +55,10 @@
$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'] = '<p><b>Update local:</b> 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.</p>';
$string['auth_updateremote'] = 'Update external';
$string['auth_updateremotefield'] = 'Update external ({$a})';
$string['auth_updateremote_expl'] = '<p><b>Update external:</b> If enabled, the external auth will be updated when the user record is updated. Fields should be unlocked to allow edits.</p>';
$string['auth_updateremote_ldap'] = '<p><b>Note:</b> 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. </p>';
$string['auth_user_create'] = 'Enable user creation';
Expand Down
10 changes: 5 additions & 5 deletions lib/authlib.php
Expand Up @@ -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));
}
}
}

0 comments on commit 3ee5023

Please sign in to comment.