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
|
pattern = Regex.new regex, Regex::Options::IGNORE_CASE
|
||||||
users.each do |u|
|
users.each do |u|
|
||||||
if pattern =~ u.login || u.profile.try do |profile|
|
if pattern =~ u.login || u.profile.try do |profile|
|
||||||
full_name = profile["full_name"]?
|
full_name = profile["full_name"]?
|
||||||
if full_name.nil?
|
if full_name.nil?
|
||||||
false
|
false
|
||||||
else
|
else
|
||||||
pattern =~ full_name.as_s
|
pattern =~ full_name.as_s
|
||||||
|
end
|
||||||
|
end || u.contact.email.try do |email|
|
||||||
|
pattern =~ email
|
||||||
end
|
end
|
||||||
end
|
|
||||||
Baguette::Log.debug "#{u.login} matches #{pattern}"
|
Baguette::Log.debug "#{u.login} matches #{pattern}"
|
||||||
matching_users << u.to_public
|
matching_users << u.to_public
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue