Switch to MariaDB connector and Create UserManager Class

This commit is contained in:
2024-11-26 16:40:00 +01:00
parent 12eb6cf2f4
commit 3df853b5c9
12 changed files with 1169 additions and 46 deletions

View File

@@ -10,7 +10,7 @@ GridLayout
rowSpacing: 9
// anchors.fill: parent
property string name: "pyqcrm"
property string name: "user"
Label
{
@@ -34,7 +34,7 @@ GridLayout
placeholderText: qsTr("Hier Benutzername eingeben")
Layout.fillWidth: true
height: 3
property string name: "PYQCRM_ADMIN"
property string name: "PYQCRM_USER"
}
Label
@@ -49,7 +49,7 @@ GridLayout
echoMode: TextInput.Password
placeholderText: qsTr("Hier Passwort eingeben")
Layout.fillWidth: true
property string name: "PYQCRM_ADMIN_PASS"
property string name: "PYQCRM_USER_PASS"
}
Label
{
@@ -62,7 +62,7 @@ GridLayout
id: gecos
placeholderText: qsTr("Zusätzliche Info")
Layout.fillWidth: true
property string name: "PYQCRM_ADMIN_INFO"
property string name: "PYQCRM_USER_INFO"
}
Item

View File

@@ -49,6 +49,7 @@ GridLayout
id: dbPort
placeholderText: qsTr("Hier DB-Port eingeben")
Layout.fillWidth: true
validator: IntValidator{bottom: 1025; top: 65535;}
property string name: "DB_PORT"
}

View File

@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Dialogs
import "../js/qmldict.js" as Qmldict
@@ -22,6 +23,66 @@ import "../js/qmldict.js" as Qmldict
Item
{
Component.onCompleted:
{
config.dbConnectionError.connect(onDbConnectionError)
config.adminUserError.connect(onAdminUserError)
}
function onDbConnectionError(msg, success)
{
if (!success)
conErrDialog.open()
}
function onAdminUserError(msg, success)
{
if (success)
{
encryptPwDialog.open()
}
else
firstStart.push("AdminUserConfig.qml")
}
MessageDialog
{
id: conErrDialog
text: qsTr("Datenbankverbindung fehlgeschlagen")
title: qsTr("Datenbank Verbindung")
}
Dialog
{
id: encryptPwDialog
modal: true
title: qsTr("Encryption Key")
anchors.centerIn: parent
standardButtons: Dialog.Ok | Dialog.Cancel
onAccepted: config.setEncyrptKey(encryptPassword.text)
ColumnLayout
{
RowLayout
{
Label
{
text: qsTr("Encryption Key eingeben:")
}
TextField
{
id: encryptPassword
echoMode: TextInput.Password
implicitWidth: 300
placeholderText: qsTr("Hier Encryption Key eingeben")
}
}
}
}
anchors.fill: parent
StackView
{
@@ -66,14 +127,7 @@ Item
if (pyqcrm_conf)
{
admin = config.setConfig(pyqcrm_conf)
if (admin)
{
firstStart.push("EncryptionKey.qml")
}
else
{
firstStart.push("AdminUserConfig.qml")
}
}
}
else

View File

@@ -106,11 +106,6 @@ ApplicationWindow
implicitWidth: 300
}
}
}
}
}