Rework invitation system and add qrcode

This commit is contained in:
2025-12-27 07:16:39 +01:00
parent 5e54c1d383
commit 51b016aa69
6 changed files with 73 additions and 40 deletions

View File

@@ -43,11 +43,24 @@ def valid_username(username):
valid=True
# Caractères non autorisés dans la RFC #822
invalid_char = { '(', ')', '<', '>', ',', ';', ':', '"', '[', ']', '|', 'ç', '%', '&', ' ' }
for character in invalid_char:
if character in username:
valid=False
conn = sqlite3.connect(DATABASE) # Connexion à la base de donnée
cursor = conn.cursor() # Création de l'objet "curseur"
cursor.execute("""SELECT name FROM users WHERE name=?""", (username,))
tmp = cursor.fetchone()
conn.close()
if tmp:
valid = True
else:
valid = False
return valid
def set_mail_domain():
@@ -109,7 +122,7 @@ def valid_token_register(token, token_type):
cursor.execute("""SELECT name FROM users where token=?""", (token,))
tmp = cursor.fetchone()
conn.close()
print (tmp)
if tmp:
valid = True
else:
@@ -121,7 +134,6 @@ def valid_token_register(token, token_type):
def get_user_by_token(token, token_type):
if len(token) != 30 and len(token) != 64:
user = "Invalid Token"