From fb9d4eef0b0278f9c8256d6b6595616b0ea04fa6 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 22 Feb 2021 12:24:54 +0800 Subject: [PATCH] remove puts --- lib/ldap_login/login.rb | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/lib/ldap_login/login.rb b/lib/ldap_login/login.rb index 5997245..4bef0ab 100644 --- a/lib/ldap_login/login.rb +++ b/lib/ldap_login/login.rb @@ -17,21 +17,20 @@ module LdapLogin::Login ldap.port = 389 ldap.auth "#{ldap_user}@asia.edu.tw", ldap_pass if ldap.bind - puts ['ldap_user',ldap_user,'ldap_pass',ldap_pass] if !user.nil? - filter = Net::LDAP::Filter.eq( "sAMAccountName", ldap_user ) - treebase = "ou=Asia Univ,dc=asia,dc=edu,dc=tws" - puts "==LDAP SEARCH START==" - ldap.search( :base => treebase, :filter => filter, :return_result => false ) do |entry| - puts "DN: #{entry.dn}" - entry.each do |attribute, values| - puts " #{attribute}:" - values.each do |value| - puts " --->#{value}" - end - end - end - puts "==LDAP SEARCH END==" + #filter = Net::LDAP::Filter.eq( "sAMAccountName", ldap_user ) + #treebase = "ou=Asia Univ,dc=asia,dc=edu,dc=tws" + #puts "==LDAP SEARCH START==" + #ldap.search( :base => treebase, :filter => filter, :return_result => false ) do |entry| + # puts "DN: #{entry.dn}" + # entry.each do |attribute, values| + # puts " #{attribute}:" + # values.each do |value| + # puts " --->#{value}" + # end + # end + #end + 3puts "==LDAP SEARCH END==" session[:user_id] = user.id session[:login_referer] = nil if params[:referer_url]