diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f0ca5bfc8..0060a8989 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,6 +9,7 @@ class ApplicationController < ActionController::Base before_filter :set_friends_and_status, :except => [:create, :update] before_filter :count_requests + before_filter :fb_user_info layout :layout_by_resource @@ -37,4 +38,9 @@ class ApplicationController < ActionController::Base @request_count = Request.for_user(current_user).size if current_user end + def fb_user_info + @access_token = cookies[:access_token] + @logged_in = @access_token.present? + end + end diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index ddbc9c10a..bfb4e92e1 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -56,10 +56,18 @@ %br %br - %h3 Connect with Facebook - %p - = link_to "Login to Facebook", @fb_access_url + %h2 Services + + %h3 Facebook + + - if @logged_in + Logged in to facebook as + - @response_hash = MiniFB.get(@access_token, @id, :type => "user") + = @response_hash[:user][:name] + %p + = link_to "Login to Facebook", @fb_access_url + #submit_block = link_to "Cancel", root_path