Group / Role Synch
May 29, 2008 – 14:15Based on work for another client I wrote a local cron script to synchronise groups and roles over different courses based on a template course.
What the script does is load all users from each group in the template course and compare that array with the users in the synonymous group in each other (non-hidden) course. If users exist in the template course group and not in the course group, users are added to that group. If users are in course group but not in template course group, users are removed from that group.
Similarly the scripts fills an array with users by role from the template course and synchs that role over the other course. Roles are defined in an array at the top of the script so multiple roles can be synched.




















Sorry, comments for this entry are closed at this time.