Search: try to match the email address too.
parent
494b0b3719
commit
4a10456f27
|
@ -22,13 +22,15 @@ class AuthD::Request
|
|||
pattern = Regex.new regex, Regex::Options::IGNORE_CASE
|
||||
users.each do |u|
|
||||
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
|
||||
full_name = profile["full_name"]?
|
||||
if full_name.nil?
|
||||
false
|
||||
else
|
||||
pattern =~ full_name.as_s
|
||||
end
|
||||
end || u.contact.email.try do |email|
|
||||
pattern =~ email
|
||||
end
|
||||
end
|
||||
Baguette::Log.debug "#{u.login} matches #{pattern}"
|
||||
matching_users << u.to_public
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue