Hello,
I'm trying to do a script PHP using MoodleRest (https://github.com/llagerlof/MoodleRest) to create a user (if it doesn't exist), i can find users created manually (probably because they are using the website..., when newly created accounts are not using it yet).
I use core_user_create_users if core_user_get_users or core_user_get_users_by_field returns no user, but if i run my script twice : imagine a administrator who is confirming a course enrollment for a new user, the second time the user is created already and core_user_get_users needs to return the user id, but because the user didn't connect in the time between (i think), core_user_get_users return nothing.
Is this intended ?
My ultimate goal is to get the user id to use enrol_manual_enrol_users.