Sync LDAP accounts to Redmine

Published by cybso on

You can configure Redmine to use an LDAP or Active Directory server as login backend. Whenever a new user has been successfully authenticated against this service, a new entry in the Redmine's user table is created.

A side effect of this is that you can't work with users that have not logged in into your instance, yet.

To solve this I've created a small python script that can be used to periodically synchronize the users table with your directory services:

https://gist.github.com/Cybso/2d9b27589f657b057c34

Not only it creates stubs for users that WOULD be able to login into Redmine, but also disables users that are not able to login anymore.

Just create a cron job like this to update the users once a day:

0 3 * * * redmineuser /usr/local/bin/redmine-ldapsync.py /srv/redmine/config/database.yml