]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3788 When doing a Change password action in the Users administration page,...
authorJulien Lancelot <julien@roulian.net>
Mon, 19 Nov 2012 15:22:08 +0000 (16:22 +0100)
committerJulien Lancelot <julien@roulian.net>
Mon, 19 Nov 2012 15:22:08 +0000 (16:22 +0100)
sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb

index b4af2a621ba8fa794a45a6496784e3978f111706..b581d0d99c2e5960081409f5f80ae9f3654e9a3a 100644 (file)
@@ -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