From: Julien Lancelot Date: Mon, 19 Nov 2012 15:22:08 +0000 (+0100) Subject: SONAR-3788 When doing a Change password action in the Users administration page,... X-Git-Tag: 3.4~327 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4f8d75d57b5c8a43aac2d927aa31dd84aaa4961a;p=sonarqube.git SONAR-3788 When doing a Change password action in the Users administration page, all deactivated users are displayed --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb index b4af2a621ba..b581d0d99c2 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb @@ -35,7 +35,7 @@ class UsersController < ApplicationController if user.update_attributes(params[:user]) # 2- if info correctly saved, then we display a message to ask wether the user should be reactivated or not @user = user - @users = User.find(:all, :conditions => ["active=?", true], :include => 'groups') + init_users_list render :index else to_index(user.errors, nil) @@ -66,7 +66,7 @@ class UsersController < ApplicationController end def index - @users = User.find(:all, :conditions => ["active=?", true], :include => 'groups') + init_users_list if params[:id] @user = User.find(params[:id]) else @@ -83,7 +83,7 @@ class UsersController < ApplicationController end def change_password - @users = User.find(:all, :include => 'groups') + init_users_list @user = User.find(params[:id]) render :action => 'index', :id => params[:id] end @@ -180,4 +180,10 @@ class UsersController < ApplicationController render :partial => 'autocomplete' end + private + + def init_users_list + @users = User.find(:all, :conditions => ["active=?", true], :include => 'groups') + end + end