mirror of https://github.com/arendst/Tasmota.git
Amended wifi password UI to show "****".
Only store passwords which are not equal to "****". Removes previous behaviour where wifi password with an asterisk was ignored.
This commit is contained in:
parent
1fde362998
commit
02f1052440
|
@ -419,6 +419,7 @@
|
|||
/********************************************************************************************/
|
||||
|
||||
#define D_ASTERIX "********"
|
||||
#define D_ASTERISK_PWD "****"
|
||||
|
||||
#ifndef MY_LANGUAGE
|
||||
#include "language/en-GB.h"
|
||||
|
|
|
@ -280,9 +280,9 @@ const char HTTP_FORM_WIFI[] PROGMEM =
|
|||
"<fieldset><legend><b> " D_WIFI_PARAMETERS " </b></legend>"
|
||||
"<form method='get' action='wi'>"
|
||||
"<p><b>" D_AP1_SSID "</b> (" STA_SSID1 ")<br/><input id='s1' name='s1' placeholder='" STA_SSID1 "' value='{s1'></p>"
|
||||
"<p><b>" D_AP1_PASSWORD "</b><br/><input id='p1' name='p1' type='password' placeholder='" D_AP1_PASSWORD "' value='" D_ASTERIX "'></p>"
|
||||
"<p><b>" D_AP1_PASSWORD "</b><br/><input id='p1' name='p1' type='password' placeholder='" D_AP1_PASSWORD "' value='" D_ASTERIX_PWD "'></p>"
|
||||
"<p><b>" D_AP2_SSID "</b> (" STA_SSID2 ")<br/><input id='s2' name='s2' placeholder='" STA_SSID2 "' value='{s2'></p>"
|
||||
"<p><b>" D_AP2_PASSWORD "</b><br/><input id='p2' name='p2' type='password' placeholder='" D_AP2_PASSWORD "' value='" D_ASTERIX "'></p>"
|
||||
"<p><b>" D_AP2_PASSWORD "</b><br/><input id='p2' name='p2' type='password' placeholder='" D_AP2_PASSWORD "' value='" D_ASTERIX_PWD "'></p>"
|
||||
"<p><b>" D_HOSTNAME "</b> (" WIFI_HOSTNAME ")<br/><input id='h' name='h' placeholder='" WIFI_HOSTNAME" ' value='{h1'></p>";
|
||||
|
||||
const char HTTP_FORM_LOG1[] PROGMEM =
|
||||
|
@ -1082,9 +1082,9 @@ void WifiSaveSettings(void)
|
|||
WebGetArg("s2", tmp, sizeof(tmp));
|
||||
strlcpy(Settings.sta_ssid[1], (!strlen(tmp)) ? STA_SSID2 : tmp, sizeof(Settings.sta_ssid[1]));
|
||||
WebGetArg("p1", tmp, sizeof(tmp));
|
||||
strlcpy(Settings.sta_pwd[0], (!strlen(tmp)) ? "" : (strchr(tmp,'*')) ? Settings.sta_pwd[0] : tmp, sizeof(Settings.sta_pwd[0]));
|
||||
strlcpy(Settings.sta_pwd[0], (!strlen(tmp)) ? "" : (!strcmp(tmp,D_ASTERISK_PWD)) ? Settings.sta_pwd[0] : tmp, sizeof(Settings.sta_pwd[0]));
|
||||
WebGetArg("p2", tmp, sizeof(tmp));
|
||||
strlcpy(Settings.sta_pwd[1], (!strlen(tmp)) ? "" : (strchr(tmp,'*')) ? Settings.sta_pwd[1] : tmp, sizeof(Settings.sta_pwd[1]));
|
||||
strlcpy(Settings.sta_pwd[1], (!strlen(tmp)) ? "" : (!strcmp(tmp,D_ASTERISK_PWD)) ? Settings.sta_pwd[1] : tmp, sizeof(Settings.sta_pwd[1]));
|
||||
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_WIFI D_CMND_HOSTNAME " %s, " D_CMND_SSID "1 %s, " D_CMND_SSID "2 %s"),
|
||||
Settings.hostname, Settings.sta_ssid[0], Settings.sta_ssid[1]);
|
||||
AddLog(LOG_LEVEL_INFO);
|
||||
|
|
Loading…
Reference in New Issue