Browse Source

Changed password policy (#297)

fastled
Xose Pérez 7 years ago
parent
commit
0ddd1765d9
4 changed files with 3075 additions and 3071 deletions
  1. BIN
      code/espurna/data/index.html.gz
  2. +3069
    -3065
      code/espurna/static/index.html.gz.h
  3. +4
    -4
      code/html/custom.js
  4. +2
    -2
      code/html/index.html

BIN
code/espurna/data/index.html.gz View File


+ 3069
- 3065
code/espurna/static/index.html.gz.h
File diff suppressed because it is too large
View File


+ 4
- 4
code/html/custom.js View File

@ -33,9 +33,9 @@ function initMessages() {
// http://www.the-art-of-web.com/javascript/validate-password/ // http://www.the-art-of-web.com/javascript/validate-password/
function checkPassword(str) { function checkPassword(str) {
// at least one number, one lowercase and one uppercase letter
// at least eight characters that are letters, numbers or the underscore
var re = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])\w{8,}$/;
// at least one lowercase and one uppercase letter or number
// at least five characters (letters, numbers or special characters)
var re = /^(?=.*[A-Z\d])(?=.*[a-z])[\w~!@#$%^&*\(\)<>,.\?;:{}\[\]\\|]{5,}$/;
return re.test(str); return re.test(str);
} }
@ -48,7 +48,7 @@ function validateForm(form) {
// password // password
var adminPass1 = $("input[name='adminPass1']", form).val(); var adminPass1 = $("input[name='adminPass1']", form).val();
if (adminPass1.length > 0 && !checkPassword(adminPass1)) { if (adminPass1.length > 0 && !checkPassword(adminPass1)) {
alert("The password you have entered is not valid, it must have at least 8 characters, 1 lower and 1 uppercase and 1 number!");
alert("The password you have entered is not valid, it must have at least 5 characters, 1 lowercase and 1 uppercase or number!");
return false; return false;
} }


+ 2
- 2
code/html/index.html View File

@ -45,7 +45,7 @@
<div class="pure-u-0 pure-u-md-1-4">&nbsp;</div> <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
<div class="pure-u-1 pure-u-md-3-4 hint"> <div class="pure-u-1 pure-u-md-3-4 hint">
The administrator password is used to access this web interface (user 'admin'), but also to connect to the device when in AP mode or to flash a new firmware over-the-air (OTA).<br /> The administrator password is used to access this web interface (user 'admin'), but also to connect to the device when in AP mode or to flash a new firmware over-the-air (OTA).<br />
It should have at least <strong>eight characters</strong> (letters, numbers or the underscore) and at least <strong>one number</strong>, <strong>one lowercase</strong> and <strong>one uppercase</strong> letter.</div>
It must have at least <strong>five characters</strong> (numbers and letters and any of these special characters: _,.;:~!?@#$%^&amp;*&lt;&gt;\|(){}[]) and at least <strong>one lowercase</strong> and <strong>one uppercase</strong> or <strong>one number</strong>.</div>
</div> </div>
<div class="pure-g"> <div class="pure-g">
@ -515,7 +515,7 @@
<div class="pure-u-0 pure-u-md-1-4">&nbsp;</div> <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
<div class="pure-u-1 pure-u-md-3-4 hint"> <div class="pure-u-1 pure-u-md-3-4 hint">
The administrator password is used to access this web interface (user 'admin'), but also to connect to the device when in AP mode or to flash a new firmware over-the-air (OTA).<br /> The administrator password is used to access this web interface (user 'admin'), but also to connect to the device when in AP mode or to flash a new firmware over-the-air (OTA).<br />
It should have at least <strong>eight characters</strong> (letters, numbers or the underscore) and at least <strong>one number</strong>, <strong>one lowercase</strong> and <strong>one uppercase</strong> letter.</div>
It must have at least <strong>five characters</strong> (numbers and letters and any of these special characters: _,.;:~!?@#$%^&amp;*&lt;&gt;\|(){}[]) and at least <strong>one lowercase</strong> and <strong>one uppercase</strong> or <strong>one number</strong>.</div>
</div> </div>
<div class="pure-g"> <div class="pure-g">


Loading…
Cancel
Save