kopia lustrzana https://github.com/Aircoookie/WLED
Allow editing WiFi settings
rodzic
855e606163
commit
2c583c3071
|
@ -567,13 +567,14 @@ void serveSettings(AsyncWebServerRequest* request, bool post) {
|
||||||
//else if (url.indexOf("/edit") >= 0) subPage = 10;
|
//else if (url.indexOf("/edit") >= 0) subPage = 10;
|
||||||
else subPage = SUBPAGE_WELCOME;
|
else subPage = SUBPAGE_WELCOME;
|
||||||
|
|
||||||
if (!correctPIN && strlen(settingsPIN) > 0 && (subPage > 0 && subPage < 11)) {
|
bool pinRequired = !correctPIN && strlen(settingsPIN) > 0 && (subPage > (WLED_WIFI_CONFIGURED ? SUBPAGE_MENU : SUBPAGE_WIFI) && subPage < SUBPAGE_LOCK);
|
||||||
|
if (pinRequired) {
|
||||||
originalSubPage = subPage;
|
originalSubPage = subPage;
|
||||||
subPage = SUBPAGE_PINREQ; // require PIN
|
subPage = SUBPAGE_PINREQ; // require PIN
|
||||||
}
|
}
|
||||||
|
|
||||||
// if OTA locked or too frequent PIN entry requests fail hard
|
// if OTA locked or too frequent PIN entry requests fail hard
|
||||||
if ((subPage == SUBPAGE_WIFI && wifiLock && otaLock) || (post && !correctPIN && millis()-lastEditTime < PIN_RETRY_COOLDOWN))
|
if ((subPage == SUBPAGE_WIFI && wifiLock && otaLock) || (post && pinRequired && millis()-lastEditTime < PIN_RETRY_COOLDOWN))
|
||||||
{
|
{
|
||||||
serveMessage(request, 401, FPSTR(s_accessdenied), FPSTR(s_unlock_ota), 254); return;
|
serveMessage(request, 401, FPSTR(s_accessdenied), FPSTR(s_unlock_ota), 254); return;
|
||||||
}
|
}
|
||||||
|
@ -609,7 +610,7 @@ void serveSettings(AsyncWebServerRequest* request, bool post) {
|
||||||
if (!s2[0]) strcpy_P(s2, s_redirecting);
|
if (!s2[0]) strcpy_P(s2, s_redirecting);
|
||||||
|
|
||||||
bool redirectAfter9s = (subPage == SUBPAGE_WIFI || ((subPage == SUBPAGE_SEC || subPage == SUBPAGE_UM) && doReboot));
|
bool redirectAfter9s = (subPage == SUBPAGE_WIFI || ((subPage == SUBPAGE_SEC || subPage == SUBPAGE_UM) && doReboot));
|
||||||
serveMessage(request, (correctPIN ? 200 : 401), s, s2, redirectAfter9s ? 129 : (correctPIN ? 1 : 3));
|
serveMessage(request, (!pinRequired ? 200 : 401), s, s2, redirectAfter9s ? 129 : (!pinRequired ? 1 : 3));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue