From 0d33b5224339cba0cd8d6360bcf5a326a105630b Mon Sep 17 00:00:00 2001 From: fram3d Date: Wed, 1 Nov 2023 14:11:05 +0100 Subject: [PATCH] only lowercase usernames allowed --- luser/routes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/luser/routes.py b/luser/routes.py index b980cab..a975f73 100644 --- a/luser/routes.py +++ b/luser/routes.py @@ -117,6 +117,10 @@ def register(): if len(password) < 8: return 'Error: password is too short' + # Check if username has uppercase + if username.islower() == False: + return 'Error: uppercase characters in username are not allowed' + # Create a LUSER connection luser = LUSER(LDAPHOST,LDAPADMINNAME,LDAPPASS,USERBASE,ALTUSERBASE) # Try to add user