Feature #16727
closed
redmine ldap sync plugin should allow syncing a particualr user
Added by anil venkata almost 12 years ago.
Updated almost 12 years ago.
Description
redmine ldap sync plugin has rake tasks which allows to sync all users and groups.
In our company we have an internal tool which we will use to manage redmine and gerrit. As an administrator of our company redmine, I want to sync only the new user who has been added to ldap through our internal tool. To sync all the users/groups we use rake task in the plugin. I don't think there is a rake task to sync only a particular user.
Can this plugin be enhanced to add a rake task which allows to sync a particular user, may be
sync user from ldap for a given user login name.
You just have to customize the following file: plugins/redmine_ldap_sync/lib/tasks/ldap_sync.rake
Currently the task looks like:
desc "Synchronize redmine's users fields and groups with those on LDAP"
task :sync_users => :environment do |t, args|
init_task
AuthSourceLdap.activate_users! unless ENV['ACTIVATE_USERS'].nil?
AuthSourceLdap.all.each do |as|
trace "Synchronizing '#{as.name}' users..."
as.sync_users
end
end
The fast and dirty way to achieve this is to add a check if as.name equals yourusername and execute the task 'as.sync_users' just if that check passes. This works the same for groups...
Should look like:
if as.name == "yourusername"
as.sync_users
end
I am also new to Ruby/Rails. Let me know if it works & Happy Easter,
Daniel
- Status changed from New to Closed
- Resolution set to Invalid
Please, no plugin requests here in the Redmine issue tracker.
Also available in: Atom
PDF