Revision cb14c112
Added by Marc Dequènes about 15 years ago
- ID cb14c112d3450746296c1461de37c5f6ac5f168e
conf/ldap_shadows/shadows/MilkyPond/hooks/aspects/fs.rb | ||
---|---|---|
STEP_UID = 100
|
||
DEFAULT_GROUP = 'dc-users'
|
||
|
||
def self.hook_before_create(mapper, item)
|
||
hook_common(mapper, item)
|
||
def self.hook_before_create(shadow, item)
|
||
hook_common(shadow, item)
|
||
end
|
||
|
||
def self.hook_before_modify(mapper, item)
|
||
hook_common(mapper, item)
|
||
def self.hook_before_modify(shadow, item)
|
||
hook_common(shadow, item)
|
||
end
|
||
|
||
def self.hook_common(mapper, item)
|
||
def self.hook_common(shadow, item)
|
||
unless item.attribute_present?('gidNumber')
|
||
item.primaryGroup = mapper.find_klass(:group).find(:first, DEFAULT_GROUP)
|
||
item.primaryGroup = shadow.find_klass(:group).find(:first, DEFAULT_GROUP)
|
||
end
|
||
|
||
if item.attribute_present?('uidNumber')
|
lib/ldap_shadows/aspect.rb | ||
---|---|---|
|
||
module LdapShadows
|
||
class LdapAspect
|
||
def self.hook_before_create
|
||
def self.hook_before_create(shadow, item)
|
||
end
|
||
|
||
def self.hook_before_modify
|
||
def self.hook_before_modify(shadow, item)
|
||
end
|
||
|
||
def self.hook_before_delete
|
||
def self.hook_before_delete(shadow, item)
|
||
end
|
||
|
||
def self.hook_after_create
|
||
def self.hook_after_create(shadow, item)
|
||
end
|
||
|
||
def self.hook_after_modify
|
||
def self.hook_after_modify(shadow, item)
|
||
end
|
||
|
||
def self.hook_after_delete
|
||
def self.hook_after_delete(shadow, item)
|
||
end
|
||
|
||
protected
|
Also available in: Unified diff
[fix] fixed aspects default hooks