From b84b7bad63155c1a951cc3c55ac899bbe3564f27 Mon Sep 17 00:00:00 2001 From: Matt Fu Date: Wed, 29 Feb 2012 12:35:54 +0800 Subject: [PATCH] ldap config for 0229 nccu demo --- app/controllers/sessions_controller.rb | 6 ++++-- config/initializers/middle_site_connection.rb | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 75c18d87..3dd6629e 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -9,8 +9,10 @@ class SessionsController < Devise::SessionsController login_uid = params[:user][:nccu_ldap_uid] result = false ldap = Net::LDAP.new - ldap.port = '8001' - ldap.host = '127.0.0.1' + # ldap.port = '8001' + # ldap.host = '127.0.0.1' + ldap.port = '389' + ldap.host = '140.119.166.23' ldap_filter = "(uid=#{login_uid})" ldap_base = 'ou=People,dc=nccu,dc=edu,dc=tw' ldap.authenticate("cn=uccn,ou=profile,dc=nccu,dc=edu,dc=tw","nccu2ucc") diff --git a/config/initializers/middle_site_connection.rb b/config/initializers/middle_site_connection.rb index cbe87392..ef20fc72 100644 --- a/config/initializers/middle_site_connection.rb +++ b/config/initializers/middle_site_connection.rb @@ -4,8 +4,8 @@ require 'mysql2' mid_host = { - :host => '127.0.0.1', #mruling.nccu.edu.tw - :port => 8005, + :host => 'mruling.nccu.edu.tw', #mruling.nccu.edu.tw or 127.0.0.1 + :port => 3006, #3306 or 8005 :username => "root", :password => "a3G6yWd9", :database => "RSS23_NCCU_MIDDLE",