reuse Database classes
This commit is contained in:
@@ -88,10 +88,7 @@ class ConfigLoader(QObject):
|
|||||||
|
|
||||||
def __checkAdminUser(self):
|
def __checkAdminUser(self):
|
||||||
# print(f"In {__file__} file, __checkAdminUser()")
|
# print(f"In {__file__} file, __checkAdminUser()")
|
||||||
con = DbManager().getConnection()
|
result = UserManager().checkAdmin()
|
||||||
cur = con.cursor()
|
|
||||||
cur.callproc("checkAdmin")
|
|
||||||
result = cur.fetchall()
|
|
||||||
if not result:
|
if not result:
|
||||||
#if not result[0][0] == 1:
|
#if not result[0][0] == 1:
|
||||||
self.adminUserError.emit("Kein Admin vorhanden", False)
|
self.adminUserError.emit("Kein Admin vorhanden", False)
|
||||||
|
|||||||
@@ -31,21 +31,25 @@ class UserManager(QObject):
|
|||||||
def __hashPassword(self):
|
def __hashPassword(self):
|
||||||
self.__password = Vermasseln.userPasswordHash(self.__password)
|
self.__password = Vermasseln.userPasswordHash(self.__password)
|
||||||
|
|
||||||
|
def checkAdmin(self):
|
||||||
|
self.__cur.callproc("checkAdmin")
|
||||||
|
result = self.__cur.fetchall()
|
||||||
|
return result
|
||||||
|
|
||||||
def getUser(self):
|
def getUser(self):
|
||||||
self.__closeConnection()
|
pass
|
||||||
|
|
||||||
def getUsers(self):
|
def getUsers(self):
|
||||||
self.__closeConnection()
|
pass
|
||||||
|
|
||||||
def delUser(self):
|
def delUser(self):
|
||||||
self.__closeConnection()
|
pass
|
||||||
|
|
||||||
def updateUser(self):
|
def updateUser(self):
|
||||||
self.__closeConnection()
|
pass
|
||||||
|
|
||||||
def disableUser(self):
|
def disableUser(self):
|
||||||
self.__closeConnection()
|
pass
|
||||||
|
|
||||||
@Slot(str, str)
|
@Slot(str, str)
|
||||||
def login(self, username, password):
|
def login(self, username, password):
|
||||||
@@ -67,3 +71,5 @@ class UserManager(QObject):
|
|||||||
if hash_password == hash_pw:
|
if hash_password == hash_pw:
|
||||||
self.loginOkay.emit()
|
self.loginOkay.emit()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
"lib/DB/UserDAO.py",
|
"lib/DB/UserDAO.py",
|
||||||
"lib/DB/BusinessDAO.py",
|
"lib/DB/BusinessDAO.py",
|
||||||
"lib/DB/AddressModel.py",
|
"lib/DB/AddressModel.py",
|
||||||
"lib/DB/AddressDAO.py"
|
"lib/DB/AddressDAO.py",
|
||||||
|
"lib/PyqcrmDataRoles.py"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user