mirror of
https://github.com/unraid/webgui.git
synced 2026-04-26 12:20:42 -05:00
Users: Display Password Strength (take 2½)
This commit is contained in:
@@ -72,13 +72,14 @@ function checkUsername(form) {
|
||||
}
|
||||
|
||||
function validatePassword(input) {
|
||||
var custom = ['unraid','limetech','lime-technology','bergware','squidly'];
|
||||
var strength = {0:'worst', 1:'bad', 2:'weak', 3:'good', 4:'strong'};
|
||||
if (!input) {
|
||||
$('#strength-bar').css('background-color','transparent');
|
||||
$('#strength-text').html('');
|
||||
$('.usage-disk.sys').addClass('none');
|
||||
} else {
|
||||
var bar = zxcvbn(input);
|
||||
var bar = zxcvbn(input,custom);
|
||||
switch (bar.score) {
|
||||
case 0: $('#strength-bar').css('background-color','red'); break;
|
||||
case 1: $('#strength-bar').css('background-color','yellow'); break;
|
||||
|
||||
@@ -61,13 +61,14 @@ function checkPassword(form) {
|
||||
}
|
||||
|
||||
function validatePassword(input) {
|
||||
var custom = ['unraid','limetech','lime-technology','bergware','squidly'];
|
||||
var strength = {0:'worst', 1:'bad', 2:'weak', 3:'good', 4:'strong'};
|
||||
if (!input) {
|
||||
$('#strength-bar').css('background-color','transparent');
|
||||
$('#strength-text').html('');
|
||||
$('.usage-disk.sys').addClass('none');
|
||||
} else {
|
||||
var bar = zxcvbn(input);
|
||||
var bar = zxcvbn(input,custom);
|
||||
switch (bar.score) {
|
||||
case 0: $('#strength-bar').css('background-color','red'); break;
|
||||
case 1: $('#strength-bar').css('background-color','yellow'); break;
|
||||
|
||||
Reference in New Issue
Block a user