mirror of
https://github.com/redmine/redmine.git
synced 2026-06-19 20:10:52 +02:00
- adds 'name' filter that mimics the old behavior of matching on email, login, first- or lastname - maps the 'status' url parameter to the status_id filter, and the 'name' url parameter to the new name filter Patch by Jens Krämer. git-svn-id: https://svn.redmine.org/redmine/trunk@22343 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -45,6 +45,19 @@ class UsersController < ApplicationController
|
||||
use_session = !request.format.csv?
|
||||
retrieve_query(UserQuery, use_session)
|
||||
|
||||
# API backwards compatibility: handle legacy status and name filter parameters
|
||||
unless request.format.html?
|
||||
if status_id = params[:status].presence
|
||||
@query.add_filter 'status', '=', [status_id]
|
||||
end
|
||||
if name = params[:name].presence
|
||||
@query.add_filter 'name', '~', [name]
|
||||
end
|
||||
if group_id = params[:group_id].presence
|
||||
@query.add_filter 'is_member_of_group', '=', [group_id]
|
||||
end
|
||||
end
|
||||
|
||||
if @query.valid?
|
||||
scope = @query.results_scope
|
||||
|
||||
|
||||
Reference in New Issue
Block a user