reuse Database classes
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user