diff app/controllers/application_controller.rb @ 743:7ded87cc4b80 bug_320

Bug #320: Offer login page instead of 404 for nonexistent project when user not logged in -- hiding the difference between existing private project and nonexistent one
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Tue, 08 Nov 2011 14:19:49 +0000
parents 851510f1b535
children 5e80956cc792
line wrap: on
line diff
--- a/app/controllers/application_controller.rb	Tue Nov 08 11:33:17 2011 +0000
+++ b/app/controllers/application_controller.rb	Tue Nov 08 14:19:49 2011 +0000
@@ -177,14 +177,14 @@
   def find_project
     @project = Project.find(params[:id])
   rescue ActiveRecord::RecordNotFound
-    render_404
+    User.current.logged? ? render_404 : require_login
   end
 
   # Find project of id params[:project_id]
   def find_project_by_project_id
     @project = Project.find(params[:project_id])
   rescue ActiveRecord::RecordNotFound
-    render_404
+    User.current.logged? ? render_404 : require_login
   end
 
   # Find a project based on params[:project_id]