mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
Сервер общая деавторизация при запуске
This commit is contained in:
@@ -42,6 +42,7 @@ bool InterfaceDataBaseLMS::DBisConnected()
|
||||
return isConnected();
|
||||
}
|
||||
|
||||
|
||||
//Инструкторы
|
||||
|
||||
bool InterfaceDataBaseLMS::AuthorizationInstructor(QString login, QString password)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -25,6 +25,9 @@ public:
|
||||
bool deAuthorizationInstructor(QString login);
|
||||
QString getNameInstructorByLogin(QString login);
|
||||
|
||||
//Общая деавторизация
|
||||
bool deAuthorizationAll();
|
||||
|
||||
//
|
||||
QList<Instructor> GetListAllInstructors();
|
||||
QList<Trainee> GetListAllTrainees();
|
||||
|
||||
@@ -39,6 +39,7 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
|
||||
|
||||
providerDBLMS = new ProviderDBLMS(this);
|
||||
providerDBLMS->ConnectionToDB();
|
||||
providerDBLMS->deAuthorizationAll();
|
||||
|
||||
logger = new Logger(ui->listWidgetLogger);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user