From d4e7fc871a59dd811dc1095eebbbbd781f056850 Mon Sep 17 00:00:00 2001 From: krivoshein Date: Fri, 31 Jan 2025 12:35:43 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B2=D0=B5=D1=80=20=D0=BE?= =?UTF-8?q?=D0=B1=D1=89=D0=B0=D1=8F=20=D0=B4=D0=B5=D0=B0=D0=B2=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BF=D1=80=D0=B8?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBaseLMS/interfacedatabaselms.cpp | 1 + ServerLMS/providerdblms.cpp | 21 +++++++++++++++++++++ ServerLMS/providerdblms.h | 3 +++ ServerLMS/serverlmswidget.cpp | 1 + 4 files changed, 26 insertions(+) diff --git a/DataBaseLMS/interfacedatabaselms.cpp b/DataBaseLMS/interfacedatabaselms.cpp index 68e9596..f928ed8 100644 --- a/DataBaseLMS/interfacedatabaselms.cpp +++ b/DataBaseLMS/interfacedatabaselms.cpp @@ -42,6 +42,7 @@ bool InterfaceDataBaseLMS::DBisConnected() return isConnected(); } + //Инструкторы bool InterfaceDataBaseLMS::AuthorizationInstructor(QString login, QString password) diff --git a/ServerLMS/providerdblms.cpp b/ServerLMS/providerdblms.cpp index bd006ab..0c0984c 100644 --- a/ServerLMS/providerdblms.cpp +++ b/ServerLMS/providerdblms.cpp @@ -201,6 +201,27 @@ QString ProviderDBLMS::getNameInstructorByLogin(QString login) return res; } +bool ProviderDBLMS::deAuthorizationAll() +{ + mtxAccess.lock(); + + if(! dbLMS->DBisConnected()) + { + mtxAccess.unlock(); + return false; + } + + Q_EMIT signal_BlockAutorization(true); + + bool res1 = dbLMS->deAuthorizationAllTrainees(); + bool res2 = dbLMS->deAuthorizationAllInstructors(); + + Q_EMIT signal_BlockAutorization(false); + + mtxAccess.unlock(); + return res1 && res2; +} + QList ProviderDBLMS::GetListAllInstructors() { QList listInstructors; diff --git a/ServerLMS/providerdblms.h b/ServerLMS/providerdblms.h index 96705f9..e2bf040 100644 --- a/ServerLMS/providerdblms.h +++ b/ServerLMS/providerdblms.h @@ -25,6 +25,9 @@ public: bool deAuthorizationInstructor(QString login); QString getNameInstructorByLogin(QString login); + //Общая деавторизация + bool deAuthorizationAll(); + // QList GetListAllInstructors(); QList GetListAllTrainees(); diff --git a/ServerLMS/serverlmswidget.cpp b/ServerLMS/serverlmswidget.cpp index 4e57eee..435e5fe 100644 --- a/ServerLMS/serverlmswidget.cpp +++ b/ServerLMS/serverlmswidget.cpp @@ -39,6 +39,7 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) : providerDBLMS = new ProviderDBLMS(this); providerDBLMS->ConnectionToDB(); + providerDBLMS->deAuthorizationAll(); logger = new Logger(ui->listWidgetLogger);