X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6094a97ce6297d390e5bbf733f5c2b4cc6b2076c..49fac49f9d6a3d49c2cd56b605ee1ba9323dffb6:/app/controllers/users/lists_controller.rb diff --git a/app/controllers/users/lists_controller.rb b/app/controllers/users/lists_controller.rb index a5cd7203d..7e3fa2a32 100644 --- a/app/controllers/users/lists_controller.rb +++ b/app/controllers/users/lists_controller.rb @@ -13,11 +13,12 @@ module Users ## # display a list of users matching specified criteria def show - @params = params.permit(:status, :ip, :before, :after) + @params = params.permit(:status, :username, :ip, :before, :after) users = User.all - users = users.where(:status => @params[:status]) if @params[:status] - users = users.where(:creation_address => @params[:ip]) if @params[:ip] + users = users.where(:status => @params[:status]) if @params[:status].present? + users = users.where("LOWER(email) = LOWER(?) OR LOWER(NORMALIZE(display_name, NFKC)) = LOWER(NORMALIZE(?, NFKC))", @params[:username], @params[:username]) if @params[:username].present? + users = users.where("creation_address <<= ?", @params[:ip]) if @params[:ip].present? @users_count = users.limit(501).count @users_count = I18n.t("count.at_least_pattern", :count => 500) if @users_count > 500