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

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

@@ -263,6 +263,24 @@ QByteArray DataParser::createDeAuthMessage(ClientDeAutorization *deAuth)
return array;
}
QByteArray DataParser::createQueryBlockAuth(bool block)
{
QByteArray array;
QXmlStreamWriter xmlWriter(&array);
xmlWriter.setAutoFormatting(true);
xmlWriter.writeStartDocument();
xmlWriter.writeStartElement("BlockAuth");
xmlWriter.writeAttribute("Block", block ? "1" : "0");
xmlWriter.writeEndElement();
xmlWriter.writeEndElement();
xmlWriter.writeEndDocument();
return array;
}
void DataParser::createServerSettings(QString address, QString port)

View File

@@ -28,6 +28,8 @@ public:
QByteArray createQueryTasksXMLMessage(QString type);
QByteArray createDeAuthMessage(ClientDeAutorization *deAuth);
QByteArray createQueryBlockAuth(bool block);
void createAuthData(ServerAuthorization *serverAuth);
void createAuthDataOffline(QString username,QString pass);
void addRunData(QList<int> displays);

View File

@@ -113,6 +113,19 @@ bool ConnectorToServer::sendQueryTasksXML(QString type)
return true;
}
bool ConnectorToServer::sendQueryBlockAuth(bool block)
{
if (!client->getIsConnected())
{
return false;
}
QByteArray array = dataParser->createQueryBlockAuth(block);
emit sigSendAnswerToServer(array);
return true;
}
void ConnectorToServer::setLoginName(QString name)
{
versionSelectWidget->setAuthor(name);

View File

@@ -30,6 +30,7 @@ public:
bool sendMessage(ClientMessage clientMessage);
bool sendQueryTasksXML(QString type);
bool sendQueryBlockAuth(bool block);
void SetConnectToServer();
void StopConnectToServer();