Сервер общая деавторизация при запуске

This commit is contained in:
krivoshein
2025-01-31 12:35:43 +03:00
parent c46986f9e3
commit d4e7fc871a
4 changed files with 26 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ bool InterfaceDataBaseLMS::DBisConnected()
return isConnected();
}
//Инструкторы
bool InterfaceDataBaseLMS::AuthorizationInstructor(QString login, QString password)

View File

@@ -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<Instructor> ProviderDBLMS::GetListAllInstructors()
{
QList<Instructor> listInstructors;

View File

@@ -25,6 +25,9 @@ public:
bool deAuthorizationInstructor(QString login);
QString getNameInstructorByLogin(QString login);
//Общая деавторизация
bool deAuthorizationAll();
//
QList<Instructor> GetListAllInstructors();
QList<Trainee> GetListAllTrainees();

View File

@@ -39,6 +39,7 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
providerDBLMS = new ProviderDBLMS(this);
providerDBLMS->ConnectionToDB();
providerDBLMS->deAuthorizationAll();
logger = new Logger(ui->listWidgetLogger);