Login, user in datenbank und encryption key
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from .DbManager import DbManager
|
||||
from ..PyqcrmFlags import PyqcrmFlags
|
||||
from ..Vermasseln import Vermasseln
|
||||
import mariadb
|
||||
|
||||
|
||||
|
||||
@@ -15,9 +17,24 @@ class UserManager():
|
||||
|
||||
|
||||
def createUser(self):
|
||||
self.__cur.callproc("createUser", (self.__username, self.__password, self.__info, self.__role))
|
||||
self.__con.commit()
|
||||
self.__closeConnection()
|
||||
self.__hashPassword()
|
||||
user_created = True
|
||||
try:
|
||||
self.__cur.callproc("createUser", (self.__username, self.__password, self.__info, self.__role))
|
||||
self.__con.commit()
|
||||
except mariadb.Error as e:
|
||||
print(f"Error: {e}")
|
||||
print(e.errno)
|
||||
user_created = False
|
||||
finally:
|
||||
self.__cur.close()
|
||||
#self.__closeConnection()
|
||||
return user_created
|
||||
|
||||
def __hashPassword(self):
|
||||
self.__password = Vermasseln.userPasswordHash(self.__password)
|
||||
print (self.__password)
|
||||
|
||||
|
||||
def getUser(self):
|
||||
self.__closeConnection()
|
||||
|
||||
Reference in New Issue
Block a user