The repository_ajax.php script was returning a text/plain Content-Type and
user/selector/search.php was setting the content-type when this should be
handled by with the definition of AJAX_SCRIPT.
It seems that Chrome orders fields of objects in order of array key.
Therefore we must stop using user.id in the PHP arrays, and instead
ensure that we use sequential numbers.
This commit fixes the user selector.
I have collected code that used to be in lib/adminlib.php, lib/accesslib.php and user/selector/lib.php into a new admin/roles/lib.php file.
And I added standard GPL and Moodle comments to all the files in admin/roles.
At the same time, I took the opportunity to try to work on some of the usability issues on this page. Note that I have not quite finished! So don't comment until tomorrow.
In the course of doing this, I also did: half of
MDL-11529 Show the number of assignees of each role in the change role dropdown on this page.
MDL-17067 Make it clear in the UI that admins are not allowed to unassign themselves.