comparison 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
comparison
equal deleted inserted replaced
742:2034af722d02 743:7ded87cc4b80
175 175
176 # Find project of id params[:id] 176 # Find project of id params[:id]
177 def find_project 177 def find_project
178 @project = Project.find(params[:id]) 178 @project = Project.find(params[:id])
179 rescue ActiveRecord::RecordNotFound 179 rescue ActiveRecord::RecordNotFound
180 render_404 180 User.current.logged? ? render_404 : require_login
181 end 181 end
182 182
183 # Find project of id params[:project_id] 183 # Find project of id params[:project_id]
184 def find_project_by_project_id 184 def find_project_by_project_id
185 @project = Project.find(params[:project_id]) 185 @project = Project.find(params[:project_id])
186 rescue ActiveRecord::RecordNotFound 186 rescue ActiveRecord::RecordNotFound
187 render_404 187 User.current.logged? ? render_404 : require_login
188 end 188 end
189 189
190 # Find a project based on params[:project_id] 190 # Find a project based on params[:project_id]
191 # TODO: some subclasses override this, see about merging their logic 191 # TODO: some subclasses override this, see about merging their logic
192 def find_optional_project 192 def find_optional_project