Forums | Mahara Community

Developers /
Automating Import of Users


anonymous profile picture
Account deleted
Posts: 6

15 January 2010, 12:53

Hi - We've been manually importing users using the 'Add users from CSV' feature and it's been working well.  We're looking to automate the process as students come and go. Has anyone figured out a manageable way to do that?

We don't want to just add them to the usr table because among other things, many site views need to be copied to their accounts as they are created.  So I'm thinking we need to use the engine behind 'Add users from CSV'. I assume I have to start with /admin/users/uploadcsv.php and perhaps override uploadcsv_submit().

The import also seems to not accept institution as a field in the import file, so we've been breaking up the data by institution and importing one at a time.

Thanks in advance for your input.  

 

anonymous profile picture
Account deleted
Posts: 12

17 January 2010, 22:32

Hi John,

We had a similar problem that we solved for the client by doing the following.  We used some of the code from /admin/users/uploadcsv.php as a base for an import/synchronisation script.  We then added a cron job to /lib/db/upgrade.php to run the script, and voila! problem solved.

Does that help?

Cheers,

Elliot

anonymous profile picture
Account deleted
Posts: 6

19 January 2010, 16:51

Yes, thanks. I've been working on modifying uploadcsv.php. Thanks for the tip.

John

3 results