mirror of https://github.com/jumpserver/jumpserver
perf(ldap): LDAP用户搜索,本地忽略大小写,远端支持模糊
parent
eabaae81ac
commit
2690092faf
|
@ -125,7 +125,7 @@ class LDAPServerUtil(object):
|
|||
return '(|{})'.format(extra)
|
||||
if self.search_value:
|
||||
for attr in self.config.attr_map.values():
|
||||
extra += '({}={})'.format(attr, self.search_value)
|
||||
extra += '({}={})'.format(attr, '*{}*'.format(self.search_value))
|
||||
return '(|{})'.format(extra)
|
||||
return extra
|
||||
|
||||
|
@ -222,7 +222,7 @@ class LDAPCacheUtil(object):
|
|||
elif self.search_value:
|
||||
filter_users = [
|
||||
user for user in users
|
||||
if self.search_value in ','.join(user.values())
|
||||
if self.search_value.lower() in ','.join(user.values()).lower()
|
||||
]
|
||||
else:
|
||||
filter_users = users
|
||||
|
|
Loading…
Reference in New Issue