Guest User

Untitled

a guest
Apr 10th, 2018
1,046
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. def self.authenticate(username="", password="")
  2. ldap_con.auth auth_string, password
  3.  
  4. if rs = ldap_con.bind_as(
  5. :base => base,
  6. :filter => email_filter,
  7. :password => password)
  8. user = User.new
  9. user.logged_in=true
  10. user.name = username
  11. user.ldap = rs[0].to_hash
  12. return user
  13. else
  14. return nil
  15. end
  16. end
Add Comment
Please, Sign In to add comment