override groups

This commit is contained in:
cazagen 2019-11-11 22:09:08 +00:00
parent 0c5c0eb510
commit 7f6bfd90cd

View File

@ -67,7 +67,8 @@ class LDAPUserManager(FilebasedUserManager,
def findLDAPUser(self, userid):
ldap_search_base = settings().get(["accessControl", "ldap_search_base"])
groups = settings().get(["accessControl", "groups"])
#groups = settings().get(["accessControl", "groups"])
groups = "blah"
userid = self.escapeLDAP(userid)
if ldap_search_base is None:
@ -96,6 +97,8 @@ class LDAPUserManager(FilebasedUserManager,
else:
group_filter = "(cn=%s)" % groups
group_filter = "cn=octoprint,ou=Groups,ou=People,dc=edinburghhacklab,dc=com"
query = "(&(objectClass=posixGroup)%s(memberUid=%s))" % (group_filter, userid)
self._logger.error("LDAP-AUTH QUERY:" + query)
group_result = connection.search_s(ldap_search_base, ldap.SCOPE_SUBTREE, query)