Skip to content

Commit

Permalink
V1.18.18
Browse files Browse the repository at this point in the history
  • Loading branch information
jgyates committed Sep 28, 2023
1 parent 88e25bb commit a1c2443
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion genserv.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ def doLdapLogin(username, password):
return False
try:
from ldap3 import ALL, NTLM, Connection, Server
from ldap3.utils.dn import escape_rdn
from ldap3.utils.conv import escape_filter_chars
except ImportError as importException:
LogError(
"LDAP3 import not found, run 'sudo pip install ldap3 && sudo pip3 install ldap3'"
Expand Down Expand Up @@ -382,9 +384,10 @@ def doLdapLogin(username, password):
authentication=NTLM,
auto_bind=True,
)
loginbasestr = escape_filter_chars("(&(objectclass=user)(sAMAccountName=" + AccountName + "))")
conn.search(
LdapBase,
"(&(objectclass=user)(sAMAccountName=" + AccountName + "))",
loginbasestr,
attributes=["memberOf"],
)
for user in sorted(conn.entries):
Expand Down

0 comments on commit a1c2443

Please sign in to comment.