diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-09-12 08:36:46 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-09-12 08:36:46 +0000 |
commit | 7707457145442d6177ce57c956dbe09af65df1b4 (patch) | |
tree | 2278f27bf20e08bb2f92e42ab728b4427cce6f07 /app/controllers/members_controller.rb | |
parent | 847c7367b429e8df0e0fa1dbf3e415e37dd82bf1 (diff) | |
download | redmine-7707457145442d6177ce57c956dbe09af65df1b4.tar.gz redmine-7707457145442d6177ce57c956dbe09af65df1b4.zip |
User groups branch merged.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2869 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/members_controller.rb')
-rw-r--r-- | app/controllers/members_controller.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index eb5989525..3bfa606e1 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -16,8 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class MembersController < ApplicationController - before_filter :find_member, :except => [:new, :autocomplete_for_member_login] - before_filter :find_project, :only => [:new, :autocomplete_for_member_login] + before_filter :find_member, :except => [:new, :autocomplete_for_member] + before_filter :find_project, :only => [:new, :autocomplete_for_member] before_filter :authorize def new @@ -59,17 +59,17 @@ class MembersController < ApplicationController end def destroy - @member.destroy - respond_to do |format| + if request.post? && @member.deletable? + @member.destroy + end + respond_to do |format| format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project } format.js { render(:update) {|page| page.replace_html "tab-content-members", :partial => 'projects/settings/members'} } end end - def autocomplete_for_member_login - @users = User.active.find(:all, :conditions => ["LOWER(login) LIKE ? OR LOWER(firstname) LIKE ? OR LOWER(lastname) LIKE ?", "#{params[:user]}%", "#{params[:user]}%", "#{params[:user]}%"], - :limit => 10, - :order => 'login ASC') - @project.users + def autocomplete_for_member + @principals = Principal.active.like(params[:q]).find(:all, :limit => 100) - @project.principals render :layout => false end |