Search users on login and full name (in their profile).

ipc07
Karchnu 2020-06-25 16:44:35 +02:00
parent 7b14d4a971
commit 7e1277e2d1
1 changed files with 8 additions and 1 deletions

View File

@ -406,7 +406,14 @@ class AuthD::Service
users = @users.to_a
users.each do |u|
if pattern =~ u.login
if pattern =~ u.login || u.profile.try do |profile|
full_name = profile["full_name"]?
if full_name.nil?
false
else
pattern =~ full_name.as_s
end
end
puts "#{u.login} matches #{pattern}"
matching_users << u.to_public
else