Error while calling core_user_create_user

Error while calling core_user_create_user

by David boudreault -
Number of replies: 5

Hi,

We have Moodle 2.3.

When i call the web service core_user_create_users, I have this error :

{"exception":"moodle_exception","errorcode":"auth_ldap_noconnect_all","message":"Le module LDAP ne peut pas se connecter \u00e0 aucun des serveurs No LDAP Host URL, Version or User Type specified in your LDAP settings"}

users[0][username]=dboudreault
users[0][firstname]=david2
users[0][lastname]=mika
users[0][email]=test.test@test.com
users[0][auth]=cas
users[0][password]=not cached
users[0][lang]=fr_ca

I think that this case is similar to https://tracker.moodle.org/browse/MDL-16168

But we have Moodle 2.3 and MDL-16168 is corrected.

Can someone help me ?

And how can i set the field mdl_user.trackforums via the service web ? If I check the API, we dont have a parameter "trackforums" for this field.

core_user_create_users

Structure générale

list of (
object {
username string   //Username policy is defined in Moodle security config. Must be lowercase.
password string   //Plain text password consisting of any characters
firstname string   //The first name(s) of the user
lastname string   //The family name of the user
email string   //A valid and unique email address
auth string Défaut pour « manual » //Auth plugins include manual, ldap, imap, etc
idnumber string Défaut pour «  » //An arbitrary ID code number perhaps from the institution
lang string Défaut pour « fr_ca » //Language code such as "en", must exist on server
theme string Optionnel //Theme name such as "standard", must exist on server
timezone string Optionnel //Timezone code such as Australia/Perth, or 99 for default
mailformat int Optionnel //Mail format code is 0 for plain text, 1 for HTML etc
description string Optionnel //User profile description, no HTML
city string Optionnel //Home city of the user
country string Optionnel //Home country code of the user, such as AU or CZ
preferences Optionnel //User preferences
list of (
object {
type string   //The name of the preference
value string   //The value of the preference
}
)customfields Optionnel //User custom fields (also known as user profil fields)
list of (
object {
type string   //The name of the custom field
value string   //The value of the custom field
}
)}
)

David

Average of ratings: -
In reply to David boudreault

Re: Error while calling core_user_create_user

by Json Chau -

Step 1 :  Your service has this function "core_user_create_users" yet.

Step 2: You must check your Permission "moodle/user:create"

That is 2 step important you must do

Also have a lot of things you must check....

 

In reply to Json Chau

Re: Error while calling core_user_create_user

by tamil selvi -

Hi i'm begginer  im writing code for core_user_create_users() in java using f.Promise its ask for response function bt,im getting some error. can anybody send sample code for core_user_create_users()

In reply to David boudreault

Re: Error while calling core_user_create_user

by Adrián Rodríguez -

Hello,

I don't know why but I wrote a message here some minutes ago and it seems that has been deleted.

I have the same problem with versions Moodle 2.5+ (Build: 20130530) and Moodle 2.3.2+ (Build: 20121005) while I try to add user with webservice.

I am getting error:

<EXCEPTION class="moodle_exception">
<ERRORCODE>auth_ldap_noconnect_all</ERRORCODE>
<MESSAGE>El módulo LDAP no puede conectarse a ninguno de los servidores: No LDAP Host URL, Version or User Type specified in your LDAP settings</MESSAGE>
</EXCEPTION>

I do not have LDAP configured because I do not need it. I only have CASON and manual accounts, that are working fine.

Does anybody use the webservice to create users with auth=cason ?

I have all permissions correctly and I am using other webservices functions without having issues.

In reply to David boudreault

Re: Error while calling core_user_create_user

by Tim Marwick -

I've got the same issue. Definitely a bug for those who would like to use CAS and Web Services without configuring LDAP.

Any update? Did you manage to solve the issue? What did you do?

Cheers, Tim