diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-11-20 15:40:16 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-11-20 15:40:16 +0000 |
commit | 987a5aa22114ec2e931464782351431e4dfec97c (patch) | |
tree | 57af15078250c620d494306c251ad66af779bc0b /app/controllers/search_controller.rb | |
parent | 99f9aea80a2bc43cdfc2933728f0ab72d7bf99d5 (diff) | |
download | redmine-987a5aa22114ec2e931464782351431e4dfec97c.tar.gz redmine-987a5aa22114ec2e931464782351431e4dfec97c.zip |
Anonymous users can now be allowed to create, edit, comment issues, comment news and post messages in the forums.
These permissions need to be explicitly given to the Anonymous role (Admin -> Roles & Permissions -> Anonymous).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@919 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r-- | app/controllers/search_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 2c00b3d74..7c50d4dcb 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -31,7 +31,7 @@ class SearchController < ApplicationController begin; offset = params[:offset].to_time if params[:offset]; rescue; end # quick jump to an issue - if @question.match(/^#?(\d+)$/) && Issue.find_by_id($1, :include => :project, :conditions => Project.visible_by(logged_in_user)) + if @question.match(/^#?(\d+)$/) && Issue.find_by_id($1, :include => :project, :conditions => Project.visible_by(User.current)) redirect_to :controller => "issues", :action => "show", :id => $1 return end @@ -87,7 +87,7 @@ class SearchController < ApplicationController end else operator = @all_words ? ' AND ' : ' OR ' - Project.with_scope(:find => {:conditions => Project.visible_by(logged_in_user)}) do + Project.with_scope(:find => {:conditions => Project.visible_by(User.current)}) do @results += Project.find(:all, :limit => limit, :conditions => [ (["(LOWER(name) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @scope.include? 'projects' end # if only one project is found, user is redirected to its overview |