Revision b527ce77
Added by Marc Dequènes about 15 years ago
- ID b527ce77164d4d87374b51d94265c0feee136bc6
lib/ldap_shadows.rb | ||
---|---|---|
#++
|
||
|
||
require 'ldap_shadows/info'
|
||
require 'ldap_shadows/config'
|
||
require 'ldap_shadows/lang_additions'
|
||
require 'ldap_shadows/exceptions'
|
||
require 'ldap_shadows/config'
|
||
require 'ldap_shadows/shadow'
|
||
require 'gettext'
|
||
require 'pp'
|
||
|
lib/ldap_shadows/config.rb | ||
---|---|---|
require 'yaml'
|
||
require 'kwalify'
|
||
require 'facets/hash/recursive_merge'
|
||
require 'ldap_shadows/shadow'
|
||
|
||
module LdapShadows
|
||
class Config
|
||
... | ... | |
@global_config
|
||
end
|
||
|
||
# needs 'ldap_shadows/shadow' for this feature to work
|
||
def load_shadow(shadow_name = nil)
|
||
shadow_name = self.global_config[:default_shadow] if shadow_name.nil?
|
||
if shadow_name.nil?
|
||
... | ... | |
end
|
||
config = File.read(config_file)
|
||
|
||
shadow = Shadow.new(shadow_name)
|
||
shadow = Shadow.new(shadow_name, self)
|
||
# register early (needed to load plugins)
|
||
@shadows[shadow_name] = {
|
||
:config_path => shadow_config_path,
|
lib/ldap_shadows/shadow.rb | ||
---|---|---|
class Shadow
|
||
attr_reader :name
|
||
|
||
def initialize(name)
|
||
def initialize(name, config)
|
||
@name = name
|
||
|
||
@config = Config.instance
|
||
@config = config
|
||
|
||
# cannot use anonymous modules/classes, as active_ldap needs named classes for relations
|
||
module_name = "Shadow" + name.camelize
|
Also available in: Unified diff
[cleanup] includes reorganization