forked from Utopism/redmine_ldap_sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.rb
32 lines (26 loc) · 1.15 KB
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'redmine'
require 'dispatcher'
RAILS_DEFAULT_LOGGER.info 'Starting Redmine Ldap Sync plugin for RedMine'
Redmine::Plugin.register :redmine_ldap_sync do
name 'Redmine - Ldap Sync'
author 'Ricardo Santos'
author_url 'mailto:Ricardo Santos <[email protected]>?subject=redmine_ldap_sync'
description 'Syncs users and groups with ldap'
url 'https://github.com/thorin/redmine_ldap_sync'
version '1.1.0'
requires_redmine :version_or_higher => '1.1.0'
settings :default => HashWithIndifferentAccess.new(), :partial => 'settings/ldap_sync_settings'
end
Dispatcher.to_prepare :redmine_ldap_sync do
require_dependency 'principal'
require_dependency 'user'
unless AuthSourceLdap.include? RedmineLdapSync::RedmineExt::AuthSourceLdapPatch
AuthSourceLdap.send(:include, RedmineLdapSync::RedmineExt::AuthSourceLdapPatch)
end
unless SettingsHelper.include? RedmineLdapSync::RedmineExt::SettingsHelperPatch
SettingsHelper.send(:include, RedmineLdapSync::RedmineExt::SettingsHelperPatch)
end
unless User.include? RedmineLdapSync::RedmineExt::UserPatch
User.send(:include, RedmineLdapSync::RedmineExt::UserPatch)
end
end