LdapFluff::ActiveDirectory

Public Class Methods

new(config = {}) click to toggle source
# File lib/ldap_fluff/active_directory.rb, line 3
def initialize(config = {})
  @bind_user  = config.service_user
  @bind_pass  = config.service_pass
  @anon       = config.anon_queries
  super
end

Public Instance Methods

bind?(uid = nil, password = nil) click to toggle source
# File lib/ldap_fluff/active_directory.rb, line 10
def bind?(uid = nil, password = nil)
  @ldap.auth(uid, password)
  @ldap.bind
end
group_exists?(gid) click to toggle source
# File lib/ldap_fluff/active_directory.rb, line 41
def group_exists?(gid)
  service_bind
  super
end
groups_for_uid(uid) click to toggle source

returns the list of groups to which a user belongs this query is simpler in active directory

# File lib/ldap_fluff/active_directory.rb, line 17
def groups_for_uid(uid)
  service_bind
  super
end
is_in_groups(uid, gids = [], all = false) click to toggle source

active directory stores group membership on a users model TODO: query by group individually not like this

# File lib/ldap_fluff/active_directory.rb, line 24
def is_in_groups(uid, gids = [], all = false)
  service_bind
  return true if gids == []
  begin
    groups       = @member_service.find_user_groups(uid)
    intersection = gids & groups
    return (all ? intersection == gids : intersection.size > 0)
  rescue MemberService::UIDNotFoundException
    return false
  end
end
user_exists?(uid) click to toggle source
# File lib/ldap_fluff/active_directory.rb, line 36
def user_exists?(uid)
  service_bind
  super
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.