MDL-65260 users policies: allow username in Show user identity

This commit is based on Brendan Heywood's work for MDL-52908.
This commit is contained in:
Tim Hunt 2019-04-03 11:51:14 +01:00
parent 280cfdf05c
commit ab2474726d
2 changed files with 4 additions and 4 deletions

View File

@ -174,12 +174,11 @@ if ($hassiteconfig
// Options include fields from the user table that might be helpful to
// distinguish when adding or listing users ('I want to add the John
// Smith from Science faculty').
// Username is not included as an option because in some sites, it might
// be a security problem to reveal usernames even to trusted staff.
// Custom user profile fields are not currently supported.
$temp->add(new admin_setting_configmulticheckbox('showuseridentity',
new lang_string('showuseridentity', 'admin'),
new lang_string('showuseridentity_desc', 'admin'), array('email' => 1), array(
'username' => new lang_string('username'),
'idnumber' => new lang_string('idnumber'),
'email' => new lang_string('email'),
'phone1' => new lang_string('phone1'),
@ -255,4 +254,4 @@ if ($hassiteconfig) {
new lang_string('sitepolicyguest_help', 'core_admin'), (isset($CFG->sitepolicy) ? $CFG->sitepolicy : ''), PARAM_RAW));
$ADMIN->add('privacy', $temp);
}
}

View File

@ -353,7 +353,8 @@ class course_enrolment_table extends html_table implements renderable {
* @var array
*/
protected static $sortablefields = array('firstname', 'lastname', 'firstnamephonetic', 'lastnamephonetic', 'middlename',
'alternatename', 'idnumber', 'email', 'phone1', 'phone2', 'institution', 'department', 'lastaccess', 'lastcourseaccess' );
'alternatename', 'username', 'idnumber', 'email', 'phone1', 'phone2',
'institution', 'department', 'lastaccess', 'lastcourseaccess');
/**
* Constructs the table