Moodle XML-RPC create user

Moodle XML-RPC create user

by Jon Pitcherella -
Number of replies: 3
Greetings All,

Currently I'm working on writing an RPC plugin for Moodle that allows some basic actions (create user, enroll user, etc.). I have my plugin all set up and the RPC to and from Moodle works fine. However I'm running into a problem with my create user method.

I get a user created in the database, however I can not log in to Moodle with my new user. I'm thinking it might have to do with not enrolling properly to the front page or a password hashing problem. Maybe it's a role problem? I'm attaching the code I'm using if that will help anyone (please keep in mind this is a first pass).

In addition, my enroll user function lets me enroll this newly created user in courses, but I still can't log in as this new user.

I'm using Moodle 1.9.4+ (Build 20090325), PHP 5.2.9-1, IIS6 and Sql Server 2005 on Windows Server 2003.

Any help is appreciated, thanks.
Average of ratings: -
In reply to Jon Pitcherella

Re: Moodle XML-RPC create user

by Jon Pitcherella -
Of course, right after I posted this, I solved my problem.

$password = md5($args[4]);

But I'd still appreciate any pointers or tips on my code or how to approach other aspects of Moodle's RPC. Thanks.
In reply to Jon Pitcherella

Re: Moodle XML-RPC create user

by Josh Marshall -
I've been scouring the net looking for some sort of explanation on how to setup XML-RPC for Moodle so that we can use it to create users.

I'm still learning and trying to understand web services so I'm trying to find a guide that speaks to someone like myself. You must have had to go through this yourself at one point to learn how to do it. So I'm hoping you can lead me in the direction to get me started.

Thanks!
In reply to Jon Pitcherella

Re: Moodle XML-RPC create user

by Moodle User -

Hello Jon,

Can you please share on the steps of ho you created the RPC and integrated with Moodle. I an in need of doing similar thing. Any guidance from you would be very helpful. Thanks a lot.