Guest User

Untitled

a guest
Mar 5th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. require 'rubygems'
  2. require 'net/ldap'
  3. module LDAP
  4. def self.authenticate(user,password)
  5. if user == '' || password == ''
  6. return false
  7. end
  8. ldap_con = Net::LDAP.new({ :host => '****', :port => 389, :auth=>{ :method=>:simple, :username => user, :password => password } })
  9. return true if ldap_con.bind
  10. return false
  11. end
  12. end
Add Comment
Please, Sign In to add comment