Hello,
1) Are you sure that the minimal list of fields provided here is enough for a successful first authentication of the created users without automatic redirection to his/her profile page to fill up missing required information ? Situation will be different depending of the auth method and synchronization strategy . Example : with ldap sync at every connexion, fisrtname, lastname and email may not be mandatory since they will be overwritten anyway at user's connexion ...
2) What about the password ? should it be converted to md5 on client before sending it to server or sent in clear and md5ized on the server ?
3) In OK tech implementation I had to make sure that the mnethostid field was also set before adding record to mdl_user table, otherwise login was later refused
4) the question of other fields, either "official" such as city, description, icq ... or "local" with the new "local custom fields" should be also addressed. Will you allow them at user creation, with some extra possible errors such as "illegal field name" or later in a set_user () or modify_user() operation ?
5) How do you return unevitable creation errors messages (duplicate username, duplicate email, missing required field, bad authentication method ... ? false seems to me not informative enough.
My 5 cents ...
We have implemented this functionality as (mdl_user_add_instance) because we want to simplify as many as possible.
To improve this functionality, we only need to extends (mdl_user_add_instance) to add_users defining:
array_users (Array) containing each user as: