diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 1ee4d787beef19a64a419486e51c4d62e3a09e00..452724bc81e169b30988ae938ad7897a72ba0600 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -50,6 +50,12 @@ class PeopleController < ApplicationController def show @person = Person.where(:id => params[:id]).first + if @person && @person.remote? && !user_signed_in? + render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404 + return + end + + @post_type = :all @aspect = :profile @share_with = (params[:share_with] == 'true') diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index e20ada74512bc63997a54c7da6283e581ccbbd92..73d18d99d7c15ad2b8f2d15aedf9915672f4a280 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -154,6 +154,13 @@ describe PeopleController do assigns[:posts].should =~ public_posts end + + it 'throws 404 if the person is remote' do + p = Factory(:person) + + get :show, :id => p.id + response.status.should == 404 + end end context "when the person is a contact of the current user" do before do