LdapFluff::Posix

Public Instance Methods

bind?(uid = nil, password = nil, opts = {}) click to toggle source
# File lib/ldap_fluff/posix.rb, line 3
def bind?(uid = nil, password = nil, opts = {})
  unless uid.include?(',') || opts[:search] == false
    service_bind
    user = @member_service.find_user(uid)
    uid = user.first.dn if user && user.first
  end
  @ldap.auth(uid, password)
  @ldap.bind
end
is_in_groups(uid, gids = [], all = true) click to toggle source

returns whether a user is a member of ALL or ANY particular groups note: this method is much faster than groups_for_uid

gids should be an array of group common names

returns true if owner is in ALL of the groups if all=true, otherwise returns true if owner is in ANY of the groups

# File lib/ldap_fluff/posix.rb, line 20
def is_in_groups(uid, gids = [], all = true)
  service_bind
  (gids.empty? || @member_service.times_in_groups(uid, gids, all) > 0)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.