fixed ##261

hier wird nun der username auf casesensitiv überprüft.
This commit is contained in:
Tim Gröger 2020-06-05 23:43:16 +02:00
parent 7d19c13071
commit 18785dad91
2 changed files with 9 additions and 3 deletions

View File

@ -38,7 +38,10 @@ class Base:
retVal.initGeruechte(creditLists)
if workgroups:
retVal.workgroups = self.getWorkgroupsOfUser(retVal.id)
return retVal
if retVal.uid == username:
return retVal
else:
return None
except Exception as err:
traceback.print_exc()
self.db.connection.rollback()

View File

@ -52,12 +52,15 @@ class LDAPController(metaclass=Singleton):
'dn': self.ldap.connection.response[0]['dn'],
'firstname': user['givenName'][0],
'lastname': user['sn'][0],
'uid': username,
'uid': user['uid'][0],
}
if user['mail']:
retVal['mail'] = user['mail'][0]
debug.debug("user is {{ {} }}".format(retVal))
return retVal
if retVal['uid'] == username:
return retVal
else:
raise Exception()
except:
debug.warning("exception in get user data from ldap", exc_info=True)
raise PermissionDenied("No User exists with this uid.")