]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_controller.rb
Redirect after processing user changes
[rails.git] / app / controllers / user_controller.rb
index 5b9f5a0c754b1feb3f6d16dc7ef1adae53e0622e..222840a0610a60ed1117594c65e746eca7742ef5 100644 (file)
@@ -339,16 +339,18 @@ class UserController < ApplicationController
 
       User.update_all("status = 'confirmed'", :id => ids) if params[:confirm]
       User.update_all("status = 'deleted'", :id => ids) if params[:hide]
-    end
-
-    conditions = Hash.new
-    conditions[:status] = params[:status] if params[:status]
-    conditions[:creation_ip] = params[:ip] if params[:ip]
 
-    @user_pages, @users = paginate(:users,
-                                   :conditions => conditions,
-                                   :order => :id,
-                                   :per_page => 50)
+      redirect_to url_for(:status => params[:status], :ip => params[:ip], :page => params[:page])
+    else
+      conditions = Hash.new
+      conditions[:status] = params[:status] if params[:status]
+      conditions[:creation_ip] = params[:ip] if params[:ip]
+
+      @user_pages, @users = paginate(:users,
+                                     :conditions => conditions,
+                                     :order => :id,
+                                     :per_page => 50)
+    end
   end
 
 private