Project

General

Profile

« Previous | Next » 

Revision 2cb97830

Added by Marc Dequènes about 14 years ago

  • ID 2cb9783056d36e1b4862e5af7fb4cbd019cf2485

[evol] use a plugins-pecific include dir to share functions among plugins easily (closes #36)

View differences:

conf/ldap_shadows/shadows/MilkyPond/plugins/objects/system_account.rb
require 'shared_attributes'
def self.hook_before_create(item)
hook_common(item)
end
......
end
def self.hook_common(item)
if item.attribute_present?('allowedServices')
user_services = ActiveLdap::Base.find(:all, :scope => :sub, :filter => "(objectClass=userService)", :attributes => ['cn'])
srv_names = user_services.collect {|srv| srv.cn }
invalid_srv_names = item.allowedServices(true) - (item.allowedServices(true) & srv_names)
unless invalid_srv_names.empty?
raise PreProcessingError, "Invalid User Service(s) name(s): " + invalid_srv_names.join(", ")
end
end
SharedAttr.check_common_attributes(item)
end

Also available in: Unified diff