From 8c4d6b972ac59504515a476d2eff92c8e2b12eb9 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 29 Nov 2013 19:35:39 +0800 Subject: [PATCH] minor fix for emailers and facebook --- app/controllers/facebook_controller.rb | 4 ++-- app/views/basic_infos/index.html.erb | 2 +- config/environments/development.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/facebook_controller.rb b/app/controllers/facebook_controller.rb index 4662301c..3abc91fe 100644 --- a/app/controllers/facebook_controller.rb +++ b/app/controllers/facebook_controller.rb @@ -59,7 +59,7 @@ class FacebookController< ApplicationController data = JSON.parse(friends) if data["success"] user = JSON.parse(data["user"]) - u = User.find(current_user.id) + u = User.find(temp_user.id) firstname = {} lastname = {} @site_valid_locales.each do |locale| @@ -87,7 +87,7 @@ class FacebookController< ApplicationController end def server_redirect - @url = "#{@@facebook_server}/login?callback=#{request.protocol}#{request.host_with_port}/facebook/register_fb?user="+current_user.id.to_s rescue nil + @url = "#{@@facebook_server}/login?callback=#{request.protocol}#{request.host_with_port}/facebook/register_fb?user="+params[:user_id] rescue nil if !@url.nil? redirect_to @url else diff --git a/app/views/basic_infos/index.html.erb b/app/views/basic_infos/index.html.erb index 698fd41f..17a35956 100644 --- a/app/views/basic_infos/index.html.erb +++ b/app/views/basic_infos/index.html.erb @@ -23,7 +23,7 @@ var facebookWindow = null, timeInterval = null; $("a.facebook").click(function(){ - facebookWindow = window.open('<%= facebook_server_path %>','login_window','height=668,width=1124,titlebar=0,statusbar=0,location=0'); + facebookWindow = window.open('<%= facebook_server_path(:user_id=>@user.id.to_s) %>','login_window','height=668,width=1124,titlebar=0,statusbar=0,location=0'); clearInterval(timeInterval); timeInterval = setInterval(function(){ if( facebookWindow.closed ){ diff --git a/config/environments/development.rb b/config/environments/development.rb index cc80c368..5dabea6a 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -25,7 +25,7 @@ Orbit::Application.configure do # config.cache_store = :mem_cache_store - config.action_mailer.default_url_options = { :host => 'localhost:3000' } + config.action_mailer.default_url_options = { :host => 'harry.tp.rulingcom.com' } config.assets.debug = false