Class: LdapFluff::Posix

Inherits:
Generic show all
Defined in:
lib/ldap_fluff/posix.rb

Direct Known Subclasses

NetIQ

Defined Under Namespace

Classes: MemberService, NetgroupMemberService

Instance Attribute Summary

Attributes inherited from Generic

#ldap, #member_service

Instance Method Summary collapse

Methods inherited from Generic

#group_exists?, #groups_for_uid, #includes_cn?, #initialize, #is_in_groups, #service_bind, #user_exists?, #users_for_gid

Constructor Details

This class inherits a constructor from LdapFluff::Generic

Instance Method Details

#bind?(uid = nil, password = nil, opts = {}) ⇒ Boolean

Returns:

  • (Boolean)


2
3
4
5
6
7
8
9
10
# File 'lib/ldap_fluff/posix.rb', line 2

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&.first
  end
  @ldap.auth(uid, password)
  @ldap.bind
end