course, cohort, enrol, role, groups and forum used to use hard-coded
MAX_USERS_PER_PAGE=100 for rendering user list. This has been converted
to $CFG->maxusersperpage.
This commit coverts everything in the codebase to use the new
users_order_by_sql function when sorting lists of users. More details in
the bug.
Note that this does not change places where users are displayed in a
sortable table, and the sort order comes from the table.