From eb57b8d17132625c0ef50b18af64531708e55b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 10 Nov 2016 10:15:12 +0100 Subject: [PATCH] Improve black list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- js/server_privileges.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/js/server_privileges.js b/js/server_privileges.js index 087af7cf4e..c04b878ad8 100644 --- a/js/server_privileges.js +++ b/js/server_privileges.js @@ -32,10 +32,19 @@ function checkAddUser(the_form) } // end of the 'checkAddUser()' function function checkPasswordStrength(value, meter_obj, meter_object_label, username = null) { - customDict = ['phpmyadmin', 'mariadb', 'mysql', 'admin']; //This list may be modified. - if (username != null) + // List of words we don't want to appear in the password + customDict = [ + 'phpmyadmin', + 'mariadb', + 'mysql', + 'php', + 'my', + 'admin', + ]; + if (username != null) { customDict.push(username) - var zxcvbn_obj = zxcvbn(value,customDict); + } + var zxcvbn_obj = zxcvbn(value, customDict); var strength = zxcvbn_obj.score; strength = parseInt(strength); meter_obj.val(strength);