Блокировка Авторизации при Редактировании в ГУИ

This commit is contained in:
2025-10-02 18:36:41 +03:00
parent 05d4e02d02
commit a70c8b5be1
14 changed files with 75 additions and 9 deletions

View File

@@ -72,6 +72,11 @@ void ProcessParser::slot_read(ClientHandler *client, QByteArray array)
clientUnityTaskFIMreport(xmlReader,client, array);
}
}
else if(xmlReader.name() == "BlockAuth")
{//Запрос Блокировки Авторизации от клиента ГУИ
clientBlockAuth(xmlReader,client);
}
else
{
emit sigLogMessage("XmlParser: unrecognized tag");
@@ -334,6 +339,24 @@ void ProcessParser::clientDeAuth(QXmlStreamReader &xmlReader,ClientHandler *clie
processingSystem->processingClientDeAutorization(client, clientDeAutorization);
}
void ProcessParser::clientBlockAuth(QXmlStreamReader &xmlReader, ClientHandler *client)
{
bool block = false;
/*Перебираем все атрибуты тега*/
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
{
QString name = attr.name().toString();
QString value = attr.value().toString();
//addTextToLogger(name + ": " + value);
if(name == "Block")
block = (value == "1") ? true : false;
}
processingSystem->processingClientBlockAuth(client, block);
}
void ProcessParser::queryToDb(QXmlStreamReader &xmlReader,ClientHandler *client, QByteArray array)
{
ClientQueryToDB queryToDB;

View File

@@ -25,6 +25,7 @@ private:
ProcessingSystem *processingSystem;
void clientAuth(QXmlStreamReader &xmlReader,ClientHandler *client);
void clientDeAuth(QXmlStreamReader &xmlReader,ClientHandler *client);
void clientBlockAuth(QXmlStreamReader &xmlReader,ClientHandler *client);
void toClientMessage(QXmlStreamReader &xmlReader,ClientHandler *client);
void queryToDb(QXmlStreamReader &xmlReader,ClientHandler *client, QByteArray array = QByteArray());
void queryTasksXML(QXmlStreamReader &xmlReader,ClientHandler *client);

View File

@@ -101,6 +101,7 @@ void ProcessingSystem::processingClientAutorization(ClientHandler *client, Clien
void ProcessingSystem::processingClientDeAutorization(ClientHandler *client, ClientDeAutorization clientDeAutorization)
{
/*
if(server->getStateBlockAutorization() == blocked)
{
QByteArray arrayAnswer = dataParser->ClientAnswer()->notify(NOTIFY_SERVER_BLOCKED);
@@ -111,6 +112,7 @@ void ProcessingSystem::processingClientDeAutorization(ClientHandler *client, Cli
return;
}
*/
//Попытка ДеАвторизации клиента (проверка по БД)
QByteArray arrayAnswer;
@@ -148,6 +150,11 @@ void ProcessingSystem::processingClientDeAutorization(ClientHandler *client, Cli
emit sigListsInstructorsTraineesChanged();
}
void ProcessingSystem::processingClientBlockAuth(ClientHandler *client, bool block)
{
emit providerDBLMS->signal_BlockAutorization(block);
}
//упращенная деавторизация при выключении сервера
void ProcessingSystem::processingClientDeAutorization(QString login)
{

View File

@@ -34,6 +34,7 @@ public:
void processingClientAutorization(ClientHandler *client, ClientAutorization clientAutorization);
void processingClientDeAutorization(ClientHandler *client, ClientDeAutorization clientDeAutorization);
void processingClientBlockAuth(ClientHandler *client, bool block);
void processingClientQueryToDB(ClientHandler *client, ClientQueryToDB clientQueryToDB, int id = 0, void* data = nullptr);
void processingClientQueryTasksXML(ClientHandler *client, ClientQueryTasksXML clientQueryTasksXML);