Skip to content

Commit

Permalink
Merge branch 'MDL-61718-master' of git://github.com/junpataleta/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Mar 28, 2018
2 parents 51c6cfb + a20a2ac commit 4b96d7c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions admin/user.php
Expand Up @@ -160,10 +160,13 @@

// Carry on with the user listing
$context = context_system::instance();
$extracolumns = get_extra_user_fields($context);
// These columns are always shown in the users list.
$requiredcolumns = array('city', 'country', 'lastaccess');
// Extra columns containing the extra user fields, excluding the required columns (city and country, to be specific).
$extracolumns = get_extra_user_fields($context, $requiredcolumns);
// Get all user name fields as an array.
$allusernamefields = get_all_user_name_fields(false, null, null, null, true);
$columns = array_merge($allusernamefields, $extracolumns, array('city', 'country', 'lastaccess'));
$columns = array_merge($allusernamefields, $extracolumns, $requiredcolumns);

foreach ($columns as $column) {
$string[$column] = get_user_field_name($column);
Expand Down

0 comments on commit 4b96d7c

Please sign in to comment.