diff --git a/src/EspBootstrapDict.h b/src/EspBootstrapDict.h
index 17c273f..5e4e517 100644
--- a/src/EspBootstrapDict.h
+++ b/src/EspBootstrapDict.h
@@ -41,7 +41,7 @@ class EspBootstrapDict : public EspBootstrapBase {
EspBootstrapDict();
virtual ~EspBootstrapDict();
- int8_t run(Dictionary &aDict, uint8_t aNum = 0, uint32_t aTimeout = 10 * BOOTSTRAP_MINUTE);
+ int8_t run(Dictionary &aDict, uint8_t aNum = 0, uint32_t aTimeout = 10 * BOOTSTRAP_MINUTE, bool aSecPass = true);
void handleRoot ();
void handleSubmit ();
inline void cancel() { iCancelAP = true; } ;
@@ -51,6 +51,7 @@ class EspBootstrapDict : public EspBootstrapBase {
int8_t doRun();
bool iCancelAP;
+ bool iSecurePassword;
Dictionary* iDict;
};
@@ -75,7 +76,7 @@ void __espbootstrap_handlesubmit() {
}
-int8_t EspBootstrapDict::run(Dictionary &aDict, uint8_t aNum, uint32_t aTimeout) {
+int8_t EspBootstrapDict::run(Dictionary &aDict, uint8_t aNum, uint32_t aTimeout, bool aSecPass) {
if (aNum == 0) {
iNum = aDict.count() - 1;
}
@@ -87,6 +88,7 @@ int8_t EspBootstrapDict::run(Dictionary &aDict, uint8_t aNum, uint32_t aTimeout)
iDict = &aDict;
iTimeout = aTimeout;
+ iSecurePassword = aSecPass;
iCancelAP = false;
return doRun();
@@ -165,7 +167,7 @@ void EspBootstrapDict::handleRoot() {
for (int i = 1; i <= iNum; i++) {
String s = d(i);
s.toUpperCase();
- if ( s.indexOf("PASSWORD") >= 0 || s.indexOf("PWD") >= 0 ) {
+ if ( iSecurePassword && (s.indexOf("PASSWORD") >= 0 || s.indexOf("PWD") >= 0) ) {
snprintf(buf, BUFLEN, "
", i, d(i).c_str(), i, i, d[i].c_str() );
}
else {
diff --git a/src/EspBootstrapMap.h b/src/EspBootstrapMap.h
index c123f84..8e0fac4 100644
--- a/src/EspBootstrapMap.h
+++ b/src/EspBootstrapMap.h
@@ -41,7 +41,7 @@ class EspBootstrapMap : public EspBootstrapBase {
EspBootstrapMap();
virtual ~EspBootstrapMap();
- int8_t run(const char** aTitles, char** aMap, uint8_t aNum, uint32_t aTimeout = 10 * BOOTSTRAP_MINUTE);
+ int8_t run(const char** aTitles, char** aMap, uint8_t aNum, uint32_t aTimeout = 10 * BOOTSTRAP_MINUTE, bool aSecPass = true);
void handleRoot ();
void handleSubmit ();
inline void cancel() { iCancelAP = true; } ;
@@ -51,6 +51,7 @@ class EspBootstrapMap : public EspBootstrapBase {
int8_t doRun();
bool iCancelAP;
+ bool iSecurePassword;
const char** iTitles;
char** iMap;
};
@@ -76,14 +77,15 @@ void __espbootstrap_handlesubmit() {
}
-int8_t EspBootstrapMap::run(const char** aTitles, char** aMap, uint8_t aNum, uint32_t aTimeout) {
+int8_t EspBootstrapMap::run(const char** aTitles, char** aMap, uint8_t aNum, uint32_t aTimeout, bool aSecPass) {
iNum = aNum;
iTitles = aTitles;
iMap = aMap;
iTimeout = aTimeout;
iCancelAP = false;
-
+ iSecurePassword = aSecPass;
+
return doRun();
}
@@ -157,7 +159,12 @@ void EspBootstrapMap::handleRoot() {
iServer->sendContent(buf);
for (int i = 1; i <= iNum; i++) {
- snprintf(buf, BUFLEN, "
", i, iTitles[i], i, i, iMap[i - 1] );
+ if ( iSecurePassword && false ) { // fr future use
+ snprintf(buf, BUFLEN, "
", i, iTitles[i], i, i, iMap[i - 1] );
+ }
+ else {
+ snprintf(buf, BUFLEN, "
", i, iTitles[i], i, i, iMap[i - 1] );
+ }
iServer->sendContent(buf);
}
iServer->sendContent("