problem using uploaduser.php

problem using uploaduser.php

by Venita Doughty -
Number of replies: 2

We have been using uploaduser.php for a few weeks now, one class at a time, which has been wonderful, but now we are having a problem. We do not allow students to enroll themselves, so we add enrollment keys to all our classes, and then don't give them out. We are running Moodle 1.2.1 and PHP 4.3.5 on Linux with Postgres.

As the beginning of the fall semester is fast approaching (when we offer many more classes than in our slower summer semester), we now need to enroll hundreds of students in multiple classes. What we used to do with Blackboard was write a query to generate a batch upload file for each course, and then concatenate the files into a single file to save time. I tried this with Moodle a couple of days ago, but forgot about the header with the field names. I tried to upload users from a file that had the header line repeated 7 times throughout the file.

Since then, whenever we have tried to upload users, an almost blank user is enrolled (named changeme) and no other students are enrolled. I tried uploading users against our test 1.3.1 Moodle server, which worked fine.

Will upgrading to Moodle 1.3.1 (or even 1.3.4) solve this problem? Or by running that bad file have I somehow corrupted some data or flipped a switch that will continue to cause problems? Any suggestions on how to solve this problem?

Also, in trying to generate unique email addresses, I used 12345.changeme@once.com - not thinking of the similarity to the default name when using a Moodle form to create a single new user. Could that have created a problem?

TIA,
Venita Doughty
Denver Seminary

Average of ratings: -
In reply to Venita Doughty

Re: problem using uploaduser.php

by Alejandro Ortiz López -
I've seen that when the file with the user data has blank lines... by default, when Moodle creates a user with blank data, its name is "changeme"; so, when you upload your users using a file with blank lines, Moodle creates a "changeme" user. 
In reply to Alejandro Ortiz López

Re: problem using uploaduser.php

by Venita Doughty -
It looks like the extra headers acted like blank lines, so we did indeed have a user with username "changeme". The thing I think is very strange is that as soon as we unenrolled that user from each class it was enrolled in, and then deleted its record from mdl_user - the uploads started working again.