Do not die if LDAP is not available on connect.
This commit is contained in:
parent
b79a4dc2cd
commit
03f7172e3d
1 changed files with 7 additions and 2 deletions
|
@ -16,8 +16,13 @@ module Auth::LDAP
|
|||
end
|
||||
|
||||
# ldap bind
|
||||
begin
|
||||
if !ldap.bind
|
||||
puts "NOTICE: Can't connect/bind to '#{host}', #{ldap.get_operation_result.code}, #{ldap.get_operation_result.message}"
|
||||
puts "NOTICE: Can't bind to '#{config[:host]}', #{ldap.get_operation_result.code}, #{ldap.get_operation_result.message}"
|
||||
return
|
||||
end
|
||||
rescue Exception => e
|
||||
puts "NOTICE: Can't connect to '#{config[:host]}', #{e.to_s}"
|
||||
return
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue