HOLY SHIRT IT ACTUALLY FORKING WORKS

master
cazagen 5 years ago
parent c29142150a
commit 6ab399d664
  1. 5
      octoprint_auth_ldap/__init__.py

@ -34,7 +34,6 @@ class LDAPUserManager(FilebasedUserManager,
def check_auth(self, username, password): def check_auth(self, username, password):
self._logger.error("CAMERON 2")
if username in [None, ''] or password in [None, '']: if username in [None, ''] or password in [None, '']:
return None return None
ldap_conn = ldap3.Connection(LDAP_SERVER, auto_bind=ldap3.AUTO_BIND_TLS_BEFORE_BIND) ldap_conn = ldap3.Connection(LDAP_SERVER, auto_bind=ldap3.AUTO_BIND_TLS_BEFORE_BIND)
@ -64,8 +63,6 @@ class LDAPUserManager(FilebasedUserManager,
#connection.unbind_s() #connection.unbind_s()
data = self.check_auth(username, password) data = self.check_auth(username, password)
self._logger.error("wassup")
self._logger.error(str(data))
for group in self.ldapify_groups(LDAP_GROUPS): for group in self.ldapify_groups(LDAP_GROUPS):
if group in data.get('memberOf', []): if group in data.get('memberOf', []):
@ -73,7 +70,6 @@ class LDAPUserManager(FilebasedUserManager,
if not user: if not user:
self._logger.debug("Add new user") self._logger.debug("Add new user")
self.addUser(username, str(uuid.uuid4()), True) self.addUser(username, str(uuid.uuid4()), True)
self._logger.error("LDAP-CAMERON: HELLO BEN")
return True return True
else: else:
self._logger.error("LDAP-CAMERON: user or password incorrect.") self._logger.error("LDAP-CAMERON: user or password incorrect.")
@ -96,7 +92,6 @@ class LDAPUserManager(FilebasedUserManager,
return FilebasedUserManager.changeUserPassword(self, username, password) return FilebasedUserManager.changeUserPassword(self, username, password)
def findUser(self, userid=None, apikey=None, session=None): def findUser(self, userid=None, apikey=None, session=None):
self._logger.error("CAMERON 1")
local_user = FilebasedUserManager.findUser(self, userid, apikey, session) local_user = FilebasedUserManager.findUser(self, userid, apikey, session)
#If user not exists in local database, search it on LDAP #If user not exists in local database, search it on LDAP
if userid and not local_user: if userid and not local_user:

Loading…
Cancel
Save