Skip to content

Commit

Permalink
Merge pull request #203 from Suriv/193
Browse files Browse the repository at this point in the history
www_password limited to 15-characters but not validated fix #193
  • Loading branch information
glynhudson authored Jan 22, 2019
2 parents 9568881 + 6ec5799 commit 012d6c8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ uint32_t flags;
#define EEPROM_MQTT_SOLAR_SIZE 30
#define EEPROM_MQTT_GRID_IE_SIZE 30
#define EEPROM_EMON_FINGERPRINT_SIZE 60
#define EEPROM_WWW_USER_SIZE 16
#define EEPROM_WWW_PASS_SIZE 16
#define EEPROM_WWW_USER_SIZE 15
#define EEPROM_WWW_PASS_SIZE 15
#define EEPROM_OHM_KEY_SIZE 10
#define EEPROM_FLAGS_SIZE 4
#define EEPROM_SIZE 1024
Expand Down
8 changes: 5 additions & 3 deletions src/html/home.htm
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ <h2>WiFi Setup</h2>
<p data-bind="text: config.ssid"></p>
<p>
<b>Passkey:</b><br>
<input type="text" autocapitalize="none" autocapitalize="none" data-bind="textInput: config.pass">
<button data-bind="click: wifi.saveNetwork, text: (wifi.saveNetworkFetching() ? 'Saving' : (wifi.saveNetworkSuccess() ? 'Saved' : 'Connect')), disable: wifi.saveNetworkFetching">Connect</button>
</p>
</div>
Expand All @@ -110,13 +109,16 @@ <h2>WiFi Setup</h2>
<h2>Administration</h2>
<p>
<b>Username:</b><br>
<input type="text" autocapitalize="none" value="admin" data-bind="textInput: config.www_username">
<input type="text" autocapitalize="none" data-bind="textInput: config.www_username" pattern=".{15}" title="The field requires 15 characters" maxlength="15" required="">
<span class="small-text validMessage">15 characters max</span>
</p>
<p>
<b>Password:</b><br>
<input type="text" autocapitalize="none" value="openevse" data-bind="textInput: config.www_password"><br>
<input type="text" autocapitalize="none" data-bind="textInput: config.www_password" pattern=".{15}" title="The field requires 15 characters" maxlength="15" required="" >
<span class="small-text validMessage">15 characters max</span><br>
<span class="small-text">Web interface HTTP authentication.</span><br><br>
<button data-bind="click: saveAdmin, text: (saveAdminFetching() ? 'Saving' : (saveAdminSuccess() ? 'Saved' : 'Save')), disable: saveAdminFetching">Save</button>
</p>
</div>

<div class="box380 right">
Expand Down
22 changes: 22 additions & 0 deletions src/html/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,28 @@ select {
width: 280px;
padding:5px;
}
input:optional{
border-color:#ddd;
}
input:required{
border-color: #19a6ff;
}

input:required:valid{
border-color:#249C4A
}

input:required:valid + .validMessage{
display:none;
}

input:required + .validMessage{
display:block;
margin:5px 0;
}




input[type="time"] {
width: 110px;
Expand Down
2 changes: 1 addition & 1 deletion src/web_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const char _CONTENT_TYPE_JS[] PROGMEM = "application/javascript";
const char _CONTENT_TYPE_JPEG[] PROGMEM = "image/jpeg";
const char _CONTENT_TYPE_PNG[] PROGMEM = "image/png";

static const char _DUMMY_PASSWORD[] PROGMEM = "___DUMMY_PASSWORD___";
static const char _DUMMY_PASSWORD[] PROGMEM = "_DUMMY_PASSWORD";
#define DUMMY_PASSWORD FPSTR(_DUMMY_PASSWORD)

// Get running firmware version from build tag environment variable
Expand Down

0 comments on commit 012d6c8

Please sign in to comment.