I created a bat file that sits in the webroot on the server that calls both of the php scripts needed to synch account authentication and enrollment from external DB.
systempath/www/sync_enrollments_genius.bat file
c:\wamp\bin\php\php5.3.13\php.exe -f c:\wamp\www\student\auth\db\cli\sync_users.php
c:\wamp\bin\php\php5.3.13\php.exe -f c:\wamp\www\student\enrol\database\cli\sync.php
Occasionally - the call to auth\db\cli\sync_users.php generates an error
!!! Error writing to database !!!The error is caused when moodle is trying to create new accounts but finds an existing lastname (account) whose Authentication type is manual. Changing that from manual to DB should correct the problem.
!! Duplicate entry 'username' for key 'mdl_user_mneuse_uix'
'' account details below...
.
.
"
Steps to diagnose and correct the error
- turn on developer level debugging in moodle - show it to the screen
- run the cron script again
- Look at the cron output - notice the username of the account failing(trying to create in moodle)
- Look for the account in moodle - search for the lastname
- edit the account and change its authentication type from manual to external
No comments:
Post a Comment