reuse Database classes

This commit is contained in:
2024-12-10 10:46:40 +01:00
parent 77922d104c
commit 959810c9e3
3 changed files with 14 additions and 10 deletions

View File

@@ -88,10 +88,7 @@ class ConfigLoader(QObject):
def __checkAdminUser(self):
# print(f"In {__file__} file, __checkAdminUser()")
con = DbManager().getConnection()
cur = con.cursor()
cur.callproc("checkAdmin")
result = cur.fetchall()
result = UserManager().checkAdmin()
if not result:
#if not result[0][0] == 1:
self.adminUserError.emit("Kein Admin vorhanden", False)

View File

@@ -31,21 +31,25 @@ class UserManager(QObject):
def __hashPassword(self):
self.__password = Vermasseln.userPasswordHash(self.__password)
def checkAdmin(self):
self.__cur.callproc("checkAdmin")
result = self.__cur.fetchall()
return result
def getUser(self):
self.__closeConnection()
pass
def getUsers(self):
self.__closeConnection()
pass
def delUser(self):
self.__closeConnection()
pass
def updateUser(self):
self.__closeConnection()
pass
def disableUser(self):
self.__closeConnection()
pass
@Slot(str, str)
def login(self, username, password):
@@ -67,3 +71,5 @@ class UserManager(QObject):
if hash_password == hash_pw:
self.loginOkay.emit()

View File

@@ -30,6 +30,7 @@
"lib/DB/UserDAO.py",
"lib/DB/BusinessDAO.py",
"lib/DB/AddressModel.py",
"lib/DB/AddressDAO.py"
"lib/DB/AddressDAO.py",
"lib/PyqcrmDataRoles.py"
]
}