Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
bb4348a7
Commit
bb4348a7
authored
Feb 15, 2022
by
Eric Duminil
Browse files
Show password with ***** in HTML form
Needs more testing
parent
02fdbd73
Changes
3
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/src/lib/IotWebConf/src/IotWebConfParameter.cpp
View file @
bb4348a7
...
...
@@ -400,7 +400,7 @@ String PasswordParameter::renderHtml(
bool
dataArrived
,
bool
hasValueFromPost
,
String
valueFromPost
)
{
return
TextParameter
::
renderHtml
(
"password"
,
true
,
String
(
""
));
return
TextParameter
::
renderHtml
(
"password"
,
true
,
String
(
this
->
valueBuffer
));
}
void
PasswordParameter
::
debugTo
(
Stream
*
out
)
...
...
@@ -425,7 +425,7 @@ void PasswordParameter::update(String newValue)
Serial
.
print
(
this
->
getId
());
Serial
.
print
(
": "
);
#endif
if
(
newValue
.
length
()
>
0
)
if
(
newValue
!=
current
->
valueBuffer
)
{
// -- Value was set.
newValue
.
toCharArray
(
current
->
valueBuffer
,
current
->
getLength
());
...
...
ampel-firmware/src/lib/IotWebConf/src/IotWebConfTParameter.h
View file @
bb4348a7
...
...
@@ -575,7 +575,7 @@ using CharArrayDataType<len>::CharArrayDataType;
Serial
.
print
(
this
->
getId
());
Serial
.
print
(
": "
);
#endif
if
(
newValue
.
length
()
>
0
)
if
(
newValue
!=
this
->
_value
)
{
// -- Value was set.
strncpy
(
this
->
_value
,
newValue
.
c_str
(),
len
);
...
...
@@ -601,7 +601,7 @@ protected:
virtual
String
renderHtml
(
bool
dataArrived
,
bool
hasValueFromPost
,
String
valueFromPost
)
override
{
return
InputParameter
::
renderHtml
(
dataArrived
,
true
,
String
(
""
));
return
InputParameter
::
renderHtml
(
dataArrived
,
true
,
String
(
this
->
_value
));
}
private:
const
char
*
_customHtmlPwd
=
"ondblclick=
\"
pw(this.id)
\"
"
;
...
...
ampel-firmware/web_config.cpp
View file @
bb4348a7
...
...
@@ -15,7 +15,6 @@
#include
"src/lib/IotWebConf/src/IotWebConfTParameter.h"
#include
"src/lib/IotWebConf/src/IotWebConfOptionalGroup.h"
//TODO: Check memory consumption. Disable DEBUG info?
//TODO: Convert all strings to F-strings
namespace
web_config
{
...
...
@@ -114,7 +113,6 @@ namespace web_config {
TextTParameter
<
STRING_LEN
>
mqttUserParam
=
Builder
<
TextTParameter
<
STRING_LEN
>>
(
"mqtt_user"
).
label
(
"MQTT User"
).
defaultValue
(
MQTT_USER
).
build
();
//TODO: Show the number of * for password?
PasswordTParameter
<
STRING_LEN
>
mqttPasswordParam
=
Builder
<
PasswordTParameter
<
STRING_LEN
>>
(
"mqtt_password"
).
label
(
"MQTT password"
).
defaultValue
(
MQTT_PASSWORD
).
build
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment