@@ -0,0 +1,4 | |||
|
1 | <h2>404</h2> | |
|
2 | ||
|
3 | <p><%= l(:notice_file_not_found) %></p> | |
|
4 | <p><a href="javascript:history.back()">Back</a></p> |
@@ -28,6 +28,8 class AccountController < ApplicationController | |||
|
28 | 28 | def show |
|
29 | 29 | @user = User.find(params[:id]) |
|
30 | 30 | @custom_values = @user.custom_values.find(:all, :include => :custom_field) |
|
31 | rescue ActiveRecord::RecordNotFound | |
|
32 | render_404 | |
|
31 | 33 | end |
|
32 | 34 | |
|
33 | 35 | # Login request and validation |
@@ -103,6 +103,12 class ApplicationController < ActionController::Base | |||
|
103 | 103 | redirect_to_url session[:return_to] |
|
104 | 104 | session[:return_to] = nil |
|
105 | 105 | end |
|
106 | end | |
|
107 | ||
|
108 | def render_404 | |
|
109 | @html_title = "404" | |
|
110 | render :template => "common/404", :layout => true, :status => 404 | |
|
111 | return false | |
|
106 | 112 | end |
|
107 | 113 | |
|
108 | 114 | # qvalues http header parser |
@@ -41,8 +41,7 class DocumentsController < ApplicationController | |||
|
41 | 41 | @attachment.increment_download |
|
42 | 42 | send_file @attachment.diskfile, :filename => @attachment.filename |
|
43 | 43 | rescue |
|
44 | flash.now[:notice] = l(:notice_file_not_found) | |
|
45 | render :text => "", :layout => true, :status => 404 | |
|
44 | render_404 | |
|
46 | 45 | end |
|
47 | 46 | |
|
48 | 47 | def add_attachment |
@@ -62,5 +61,7 private | |||
|
62 | 61 | def find_project |
|
63 | 62 | @document = Document.find(params[:id]) |
|
64 | 63 | @project = @document.project |
|
64 | rescue ActiveRecord::RecordNotFound | |
|
65 | render_404 | |
|
65 | 66 | end |
|
66 | 67 | end |
@@ -35,8 +35,10 class IssueCategoriesController < ApplicationController | |||
|
35 | 35 | end |
|
36 | 36 | |
|
37 | 37 | private |
|
38 |
|
|
|
38 | def find_project | |
|
39 | 39 | @category = IssueCategory.find(params[:id]) |
|
40 |
|
|
|
41 | end | |
|
40 | @project = @category.project | |
|
41 | rescue ActiveRecord::RecordNotFound | |
|
42 | render_404 | |
|
43 | end | |
|
42 | 44 | end |
@@ -132,8 +132,7 class IssuesController < ApplicationController | |||
|
132 | 132 | @attachment = @issue.attachments.find(params[:attachment_id]) |
|
133 | 133 | send_file @attachment.diskfile, :filename => @attachment.filename |
|
134 | 134 | rescue |
|
135 | flash.now[:notice] = l(:notice_file_not_found) | |
|
136 | render :text => "", :layout => true, :status => 404 | |
|
135 | render_404 | |
|
137 | 136 | end |
|
138 | 137 | |
|
139 | 138 | private |
@@ -141,5 +140,7 private | |||
|
141 | 140 | @issue = Issue.find(params[:id], :include => [:project, :tracker, :status, :author, :priority, :category]) |
|
142 | 141 | @project = @issue.project |
|
143 | 142 | @html_title = "#{@project.name} - #{@issue.tracker.name} ##{@issue.id}" |
|
143 | rescue ActiveRecord::RecordNotFound | |
|
144 | render_404 | |
|
144 | 145 | end |
|
145 | 146 | end |
@@ -33,9 +33,11 class MembersController < ApplicationController | |||
|
33 | 33 | end |
|
34 | 34 | |
|
35 | 35 | private |
|
36 |
|
|
|
36 | def find_project | |
|
37 | 37 | @member = Member.find(params[:id]) |
|
38 |
|
|
|
39 | end | |
|
38 | @project = @member.project | |
|
39 | rescue ActiveRecord::RecordNotFound | |
|
40 | render_404 | |
|
41 | end | |
|
40 | 42 | |
|
41 | 43 | end |
@@ -51,8 +51,10 class NewsController < ApplicationController | |||
|
51 | 51 | end |
|
52 | 52 | |
|
53 | 53 | private |
|
54 |
|
|
|
54 | def find_project | |
|
55 | 55 | @news = News.find(params[:id]) |
|
56 |
|
|
|
57 | end | |
|
56 | @project = @news.project | |
|
57 | rescue ActiveRecord::RecordNotFound | |
|
58 | render_404 | |
|
59 | end | |
|
58 | 60 | end |
@@ -500,8 +500,8 private | |||
|
500 | 500 | def find_project |
|
501 | 501 | @project = Project.find(params[:id]) |
|
502 | 502 | @html_title = @project.name |
|
503 | rescue | |
|
504 | redirect_to :action => 'list' | |
|
503 | rescue ActiveRecord::RecordNotFound | |
|
504 | render_404 | |
|
505 | 505 | end |
|
506 | 506 | |
|
507 | 507 | # Retrieve query from session or build a new query |
@@ -45,5 +45,7 private | |||
|
45 | 45 | @project = @query.project |
|
46 | 46 | # check if user is allowed to manage queries (same permission as add_query) |
|
47 | 47 | authorize('projects', 'add_query') |
|
48 | rescue ActiveRecord::RecordNotFound | |
|
49 | render_404 | |
|
48 | 50 | end |
|
49 | 51 | end |
@@ -98,10 +98,12 class ReportsController < ApplicationController | |||
|
98 | 98 | end |
|
99 | 99 | |
|
100 | 100 | private |
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
|
104 | end | |
|
101 | # Find project of id params[:id] | |
|
102 | def find_project | |
|
103 | @project = Project.find(params[:id]) | |
|
104 | rescue ActiveRecord::RecordNotFound | |
|
105 | render_404 | |
|
106 | end | |
|
105 | 107 | |
|
106 | 108 | def issues_by_tracker |
|
107 | 109 | @issues_by_tracker ||= |
@@ -63,6 +63,8 private | |||
|
63 | 63 | @path = params[:path].squeeze('/').gsub(/^\//, '') if params[:path] |
|
64 | 64 | @path ||= '' |
|
65 | 65 | @rev = params[:rev].to_i if params[:rev] and params[:rev].to_i > 0 |
|
66 | rescue ActiveRecord::RecordNotFound | |
|
67 | render_404 | |
|
66 | 68 | end |
|
67 | 69 | |
|
68 | 70 | def show_error |
@@ -39,8 +39,7 class VersionsController < ApplicationController | |||
|
39 | 39 | @attachment.increment_download |
|
40 | 40 | send_file @attachment.diskfile, :filename => @attachment.filename |
|
41 | 41 | rescue |
|
42 | flash.now[:notice] = l(:notice_file_not_found) | |
|
43 | render :text => "", :layout => true, :status => 404 | |
|
42 | render_404 | |
|
44 | 43 | end |
|
45 | 44 | |
|
46 | 45 | def destroy_file |
@@ -53,5 +52,7 private | |||
|
53 | 52 | def find_project |
|
54 | 53 | @version = Version.find(params[:id]) |
|
55 | 54 | @project = @version.project |
|
55 | rescue ActiveRecord::RecordNotFound | |
|
56 | render_404 | |
|
56 | 57 | end |
|
57 | 58 | end |
General Comments 0
You need to be logged in to leave comments.
Login now