Merge branch 'wip-MDL-42089-master' of git://github.com/abgreeve/moodle

This commit is contained in:
Dan Poltawski 2013-10-09 10:54:24 +08:00
commit e9091a28f5
2 changed files with 4 additions and 3 deletions

View File

@ -266,7 +266,8 @@ if ($roleid) {
foreach ($assignableroles as $roleid => $notused) {
$roleusers = '';
if (0 < $assigncounts[$roleid] && $assigncounts[$roleid] <= MAX_USERS_TO_LIST_PER_ROLE) {
$roleusers = get_role_users($roleid, $context, false, 'u.id, u.firstname, u.lastname');
$userfields = 'u.id, u.username, ' . get_all_user_name_fields(true, 'u');
$roleusers = get_role_users($roleid, $context, false, $userfields);
if (!empty($roleusers)) {
$strroleusers = array();
foreach ($roleusers as $user) {

View File

@ -3328,8 +3328,8 @@ class admin_setting_users_with_capability extends admin_setting_configmultiselec
'This is unexpected, and a problem because there is no way to pass these ' .
'parameters to get_users_by_capability. See MDL-34657.');
}
$users = get_users_by_capability(context_system::instance(),
$this->capability, 'u.id,u.username,u.firstname,u.lastname', $sort);
$userfields = 'u.id, u.username, ' . get_all_user_name_fields(true, 'u');
$users = get_users_by_capability(context_system::instance(), $this->capability, $userfields, $sort);
$this->choices = array(
'$@NONE@$' => get_string('nobody'),
'$@ALL@$' => get_string('everyonewhocan', 'admin', get_capability_string($this->capability)),