change all forms to POST

#409
This commit is contained in:
Shawn A
2017-08-30 10:24:04 -05:00
parent 66c653ff94
commit 6e43c1eb41
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -382,6 +382,7 @@ uint8_t WiFiManager::waitForConnectResult() {
while(millis() < timeout) {
status = WiFi.status();
// @todo detect additional states, connect happens, then dhcp then get ip, there is some delay here, make sure not to timeout if waiting on IP
if (status == WL_CONNECTED || status == WL_CONNECT_FAILED) {
return status;
}
@@ -673,7 +674,7 @@ void WiFiManager::handleWifi(boolean scan) {
*/
void WiFiManager::handleWifiSave() {
DEBUG_WM(F("WiFi save"));
//SAVE/connect here
_ssid = server->arg("s").c_str();
_pass = server->arg("p").c_str();
+2 -2
View File
@@ -33,10 +33,10 @@ const char HTTP_STYLE[] PROGMEM = "<style>.c,body{text-align:center}di
"</style>";
const char HTTP_SCRIPT[] PROGMEM = "<script>function c(l){document.getElementById('s').value=l.innerText||l.textContent;document.getElementById('p').focus();}</script>";
const char HTTP_HEAD_END[] PROGMEM = "</head><body><div class='right' style='text-align:left;display:inline-block;min-width:260px;'>";
const char HTTP_PORTAL_OPTIONS[] PROGMEM = "<form action='/wifi' method='POST'><button>Configure WiFi</button></form><br/><form action='/0wifi' method='get'><button>Configure WiFi (No Scan)</button></form><br/><form action='/i' method='get'><button>Info</button></form><br/><form action='/r' method='post'><button>Reset</button></form>";
const char HTTP_PORTAL_OPTIONS[] PROGMEM = "<form action='/wifi' method='POST'><button>Configure WiFi</button></form><br/><form action='/0wifi' method='POST'><button>Configure WiFi (No Scan)</button></form><br/><form action='/i' method='POST'><button>Info</button></form><br/><form action='/r' method='POST'><button>Reset</button></form>";
const char HTTP_ITEM[] PROGMEM = "<div><a href='#p' onclick='c(this)'>{v}</a><div role='img' aria-label='{r}%' title='{r}%' class='q q-{q} {i}'></div></div>";
//const char HTTP_ITEM_PADLOCK[] PROGMEM = "<img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAALVBMVEX///8EBwfBwsLw8PAzNjaCg4NTVVUjJiZDRUUUFxdiZGSho6OSk5Pg4eFydHTCjaf3AAAAZElEQVQ4je2NSw7AIAhEBamKn97/uMXEGBvozkWb9C2Zx4xzWykBhFAeYp9gkLyZE0zIMno9n4g19hmdY39scwqVkOXaxph0ZCXQcqxSpgQpONa59wkRDOL93eAXvimwlbPbwwVAegLS1HGfZAAAAABJRU5ErkJggg==' width='13px'/>";
const char HTTP_FORM_START[] PROGMEM = "<form method='get' action='wifisave'><input id='s' name='s' maxlength=32 placeholder='SSID'><br/><input id='p' name='p' length=64 type='password' placeholder='password'><br/>";
const char HTTP_FORM_START[] PROGMEM = "<form method='POST' action='wifisave'><input id='s' name='s' maxlength=32 placeholder='SSID'><br/><input id='p' name='p' length=64 type='password' placeholder='password'><br/>";
const char HTTP_FORM_LABEL[] PROGMEM = "<label for='{i}'>{p}</label>";
const char HTTP_FORM_PARAM[] PROGMEM = "<br/><input id='{i}' name='{n}' maxlength={l} placeholder='{p}' value='{v}' {c}>";
const char HTTP_FORM_END[] PROGMEM = "<br/><button type='submit'>save</button></form>";