From 54b874b2c943b90ff3706ac47585a785e26b273c Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Tue, 25 Sep 2012 15:07:07 +0800 Subject: [PATCH] fix nccu login --- app/controllers/sessions_controller.rb | 2 +- config/initializers/middle_site_connection.rb | 2 +- lib/tasks/mid_site_sync.rake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index fcb523dc..b2fbc997 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -11,7 +11,7 @@ class SessionsController < Devise::SessionsController result = false ldap_filter = "(uid=#{login_uid})" if /@rulingcom.com$/.match(login_uid).nil? - # MiddleSiteConnection.establish + MiddleSiteConnection.establish NccuLdapConnection.establish if ($nccu_ldap_connection.bind rescue false) diff --git a/config/initializers/middle_site_connection.rb b/config/initializers/middle_site_connection.rb index 6d15814c..345ad464 100644 --- a/config/initializers/middle_site_connection.rb +++ b/config/initializers/middle_site_connection.rb @@ -15,7 +15,7 @@ module MiddleSiteConnection } def self.establish - # $mid_site_connection = Mysql2::Client.new(@mid_host) + $mid_site_connection = Mysql2::Client.new(@mid_host) end end \ No newline at end of file diff --git a/lib/tasks/mid_site_sync.rake b/lib/tasks/mid_site_sync.rake index e009f861..707a609b 100644 --- a/lib/tasks/mid_site_sync.rake +++ b/lib/tasks/mid_site_sync.rake @@ -9,7 +9,7 @@ namespace :mid_site do admin_role = nil sub_role = nil test_account_ldap_id ='139716' - #MiddleSiteConnection.establish + MiddleSiteConnection.establish task :sync => :environment do info_profile = Info.first(conditions: {:key => 'profile'})