|
|
@ -17,6 +17,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
class SearchController < ApplicationController |
|
|
|
class SearchController < ApplicationController |
|
|
|
layout 'base' |
|
|
|
layout 'base' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
before_filter :find_optional_project |
|
|
|
|
|
|
|
|
|
|
|
helper :messages |
|
|
|
helper :messages |
|
|
|
include MessagesHelper |
|
|
|
include MessagesHelper |
|
|
@ -36,11 +38,6 @@ class SearchController < ApplicationController |
|
|
|
return |
|
|
|
return |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if params[:id] |
|
|
|
|
|
|
|
find_project |
|
|
|
|
|
|
|
return unless check_project_privacy |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if @project |
|
|
|
if @project |
|
|
|
# only show what the user is allowed to view |
|
|
|
# only show what the user is allowed to view |
|
|
|
@object_types = %w(issues news documents changesets wiki_pages messages) |
|
|
|
@object_types = %w(issues news documents changesets wiki_pages messages) |
|
|
@ -104,8 +101,10 @@ class SearchController < ApplicationController |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
private |
|
|
|
private |
|
|
|
def find_project |
|
|
|
def find_optional_project |
|
|
|
|
|
|
|
return true unless params[:id] |
|
|
|
@project = Project.find(params[:id]) |
|
|
|
@project = Project.find(params[:id]) |
|
|
|
|
|
|
|
check_project_privacy |
|
|
|
rescue ActiveRecord::RecordNotFound |
|
|
|
rescue ActiveRecord::RecordNotFound |
|
|
|
render_404 |
|
|
|
render_404 |
|
|
|
end |
|
|
|
end |
|
|
|