|
@@ -126,6 +126,7 @@ static const char Content_Length[17] =
|
|
|
|
|
|
const char HTTP_304_NOT_MODIFIED[] = "HTTP/1.1 304 Not Modified\r\n\r\n";
|
|
|
const char HTTP_403_NOT_WHITE_LIST[] = "HTTP/1.1 403 Forbidden\r\n\r\n";
|
|
|
+const char HTTP_401_NO_AUTH[] = "HTTP/1.1 401 No authorization\r\n\r\n";
|
|
|
const char HTTP_500_SERVER_ERROR[] = "HTTP/1.1 500 Internal Server Error\r\n\r\n";
|
|
|
const char HTTP_200_OK[] = "HTTP/1.1 200 OK\r\n\r\n";
|
|
|
/* utf-8 marker to support MS Excel */
|
|
@@ -852,12 +853,15 @@ char *SSL_ProcessingRoutine(uint16_t *sendLen)
|
|
|
if (strncmp(receiveBuf, h->client_req, h->len) == 0) {
|
|
|
#ifdef HTTP_AUTH_ENABLE
|
|
|
if (h->accsess == TIME_ACCESS && !Authenticated) {
|
|
|
+ strcpy(sendBuf, HTTP_401_NO_AUTH);
|
|
|
if((sSettings.sRADIUS.RDSEnable == true) && (fl_raddius_net_err == false))
|
|
|
- fs_open("/rslogin.html", &file);
|
|
|
+ strcat(sendBuf,
|
|
|
+ "<!DOCTYPE html><html lang=""><head><meta http-equiv=\"refresh\" content=\"0;url=/rslogin.html\"/></head></html>\r\n");
|
|
|
else
|
|
|
- fs_open("/login.html", &file);
|
|
|
- *sendLen = (uint16_t)file.len;
|
|
|
- return file.data;
|
|
|
+ strcat(sendBuf,
|
|
|
+ "<!DOCTYPE html><html lang=""><head><meta http-equiv=\"refresh\" content=\"0;url=/login.html\"/></head></html>\r\n");
|
|
|
+ *sendLen = strlen(sendBuf);
|
|
|
+ return sendBuf;
|
|
|
}
|
|
|
#endif
|
|
|
return h->handler(0, receiveBuf, sendBuf, receivedBufLen, sendLen);
|
|
@@ -1306,7 +1310,7 @@ void HTTP_SetSettings(char *buf, uint16_t lenBuf)
|
|
|
/* Блокируем управление ключем на тау секунд*/
|
|
|
//IO_KeyBlockOn();
|
|
|
vTaskDelay(1010);
|
|
|
- Reboot(WEB_RESET);
|
|
|
+ Reboot(WEB_ACT);
|
|
|
}
|
|
|
|
|
|
HTTP_SaveSettings();
|
|
@@ -1537,37 +1541,32 @@ char *HTTP_UPSTest(uint32_t reqNum, char *bufIn, char *bufOut, uint16_t lenBufIn
|
|
|
if (strcmp(tempValue, "stop") == 0) {
|
|
|
res = ups_metac_service_pdu(ups_cancel_test);
|
|
|
if (res == 1 || res == 0) {
|
|
|
- strcat(bufOut, "Тест остановлен!");
|
|
|
+ strcat(bufOut, "Команда \"Останов теста\" принята ИБП!");
|
|
|
strcpy(log_string, name_login);
|
|
|
strcat(log_string, " (Останов)");
|
|
|
log_event_data(LOG_TEST_UPS, log_string);
|
|
|
}
|
|
|
if (res == -1) {
|
|
|
- strcat(bufOut, "Тест не удалось остановить!");
|
|
|
+ strcat(bufOut, "Команда \"Останов теста\" отклонена ИБП!");
|
|
|
}
|
|
|
} else if (strcmp(tempValue, "discharge") == 0) {
|
|
|
res = ups_metac_service_pdu(ups_test_low_bat);
|
|
|
+ set_act_source(WEB_ACT);
|
|
|
if (res == 1 || res == 0) {
|
|
|
- strcat(bufOut, "Тест запущен!");
|
|
|
- strcpy(log_string, name_login);
|
|
|
- strcat(log_string, " (Запущен)");
|
|
|
- log_event_data(LOG_TEST_UPS, log_string);
|
|
|
+ strcat(bufOut, "Команда \"Запуск теста\" принята ИБП!");
|
|
|
}
|
|
|
if (res == -1) {
|
|
|
- strcat(bufOut, "Тест не удалось запустить!");
|
|
|
+ strcat(bufOut, "Команда \"Запуск теста\" отклонена ИБП!");
|
|
|
}
|
|
|
} else if (strncmp(tempValue, "time", 6) == 0) {
|
|
|
GetParamValue(bufIn, "=", tempValue2, &valueLen);
|
|
|
TimeParam = atoi(tempValue2);
|
|
|
res = ups_metac_service_pdu(ups_test_time);
|
|
|
if (res == 1 || res == 0) {
|
|
|
- strcat(bufOut, "Тест запущен!");
|
|
|
- strcpy(log_string, name_login);
|
|
|
- strcat(log_string, " (Запущен)");
|
|
|
- log_event_data(LOG_TEST_UPS, log_string);
|
|
|
+ strcat(bufOut, "Команда \"Запуск теста\" принята ИБП!");
|
|
|
}
|
|
|
if (res == -1) {
|
|
|
- strcat(bufOut, "Тест не удалось запустить!");
|
|
|
+ strcat(bufOut, "Команда \"Запуск теста\" отклонена ИБП!");
|
|
|
}
|
|
|
}
|
|
|
*lenBufOut = strlen(bufOut);
|