Hi,
I know this is a late reply but perhaps someone might benefit from it in the future. I very well may be wrong so anyone please feel free to correct me.
I think the issue is in the fact that the function core_user_view_user_list is not actually meant to retrieve a list of users instead it is simply meant to imitate the action of a person viewing this list and then trigger any events that viewing the list should trigger. The description of the function is - Simulates the web-interface view of user/index.php (triggering events),.
Also, looking at the response:
General structure
object {
status int //status: true if success
warnings Optional //list of warnings
list of (
//warning
object {
item string Optional //item
itemid int Optional //item id
warningcode string //the warning code can be used by the client app to implement specific behaviour
message string //untranslated english message to explain the warning
}
)}
This doesn't indicate that any list of users is actually returned. Rather a status of true or false for if the events were triggered and then a list of warnings if applicable.
A function that could be used to retrive a list of all users would be
core_enrol_get_enrolled_users. To view all users on the site use a courseid of 0. You can also modify the fields that the response contains using some of the following options:
options (Default to "Array
(
)
")
Option names:
* withcapability (string) return only users
with this capability. This option requires 'moodle/role:review' on the
course
context.
* groupid (integer) return only users in
this group id. If the course has groups enabled and this param
isn't defined, returns
all the viewable users.
This option requires
'moodle/site:accessallgroups' on the course context if the
user doesn't belong to
the group.
* onlyactive (integer) return only users
with active enrolments and matching time restrictions. This option
requires 'moodle/course:enrolreview' on the course context.
* userfields ('string, string, ...') return
only the values of these user fields.
* limitfrom (integer)
sql limit from.
* limitnumber (integer) maximum number of
returned users.
* sortby (string) sort by id, firstname or
lastname. For ordering like the site does, use siteorder.
* sortdirection (string) ASC or DESC
Hope that saves someone some time in the future.
Regards
Shane