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