diff --git a/public/include/pages/login.inc.php b/public/include/pages/login.inc.php index 13c8b504..f2e685d5 100644 --- a/public/include/pages/login.inc.php +++ b/public/include/pages/login.inc.php @@ -48,7 +48,7 @@ if ($setting->getValue('maintenance') && !$user->isAdmin($user->getUserId($_POST } } // Check if recaptcha is enabled, process form data if valid - if (($setting->getValue('recaptcha_enabled') != 1 || $setting->getValue('recaptcha_enabled_logins') != 1 || $rsp->is_valid) && ($nocsrf == 1 || (!$config['csrf']['enabled'] || !$config['csrf']['forms']['login']))) { + if (($setting->getValue('recaptcha_enabled') != 1 || $setting->getValue('recaptcha_enabled_logins') != 1 || $rsp->is_valid) && ($nocsrf == 1 || (!$config['csrf']['enabled'] || in_array('login', $config['csrf']['disabled_forms'])))) { if ($user->checkLogin(@$_POST['username'], @$_POST['password']) ) { empty($_POST['to']) ? $to = $_SERVER['SCRIPT_NAME'] : $to = $_POST['to']; $port = ($_SERVER["SERVER_PORT"] == "80" or $_SERVER["SERVER_PORT"] == "443") ? "" : (":".$_SERVER["SERVER_PORT"]); diff --git a/public/site_assets/mpos/js/pwcheck.js b/public/site_assets/mpos/js/pwcheck.js new file mode 100644 index 00000000..5433d012 --- /dev/null +++ b/public/site_assets/mpos/js/pwcheck.js @@ -0,0 +1,78 @@ +function scorePassword(pass) { + var score = 0; + if (!pass) + return score; + var letters = new Object(); + for (var i=0; i= 80) + return "Excellent"; + if (score >= 70) + return "Strong"; + if (score >= 50) + return "Good"; + if (score >= 40) + return "Weak"; + if (score >= 10) + return "Very weak"; + if (score < 10 && score > 1) + return "Extremely weak"; + return ""; +} +function getStrengthColor(pass) { + var score = scorePassword(pass) + if (score >= 80) + return "#390" + if (score >= 70) + return "#3C0" + if (score >= 50) + return "#399" + if (score >= 40) + return "#F60" + if (score >= 10) + return "#E00" + if (score < 10) + return "#C00" + return "#999" +} +function checkIfPasswordsMatch() { + var pwMatch = document.getElementById('pw_match'); + var field1 = document.getElementById('pw_field').value; + var field2 = document.getElementById('pw_field2').value; + if (field1 == field2 && field1 !== "" && field2 !== "") { + pwMatch.innerHTML = "Passwords match!"; + pwMatch.style.color = "#390"; + } else if (field1 == "" || field2 == ""){ + pwMatch.innerHTML = ""; + } else { + pwMatch.innerHTML = "Passwords don't match!"; + pwMatch.style.color = "#399"; + } +} +$(document).ready(function() { + $("#pw_field,#pw_field2").on("keypress keyup keydown", function() { + var fieldValue = document.getElementById('pw_field').value; + var pwStrength = document.getElementById('pw_strength'); + pwStrength.innerHTML = checkPassStrength(fieldValue); + pwStrength.style.color = getStrengthColor(fieldValue); + checkIfPasswordsMatch(); + }); +}); \ No newline at end of file diff --git a/public/templates/mpos/account/edit/default.tpl b/public/templates/mpos/account/edit/default.tpl index f3a6dbc3..0a8071bc 100644 --- a/public/templates/mpos/account/edit/default.tpl +++ b/public/templates/mpos/account/edit/default.tpl @@ -144,11 +144,13 @@
- {nocache}{/nocache} +

+ {nocache}{/nocache}
- {nocache}{/nocache} +

+ {nocache}{/nocache}
diff --git a/public/templates/mpos/master.tpl b/public/templates/mpos/master.tpl index c20a966b..13159ce9 100644 --- a/public/templates/mpos/master.tpl +++ b/public/templates/mpos/master.tpl @@ -29,7 +29,7 @@ - + {if $GLOBAL.statistics.analytics.enabled} {$GLOBAL.statistics.analytics.code nofilter} {/if} diff --git a/public/templates/mpos/register/default.tpl b/public/templates/mpos/register/default.tpl index bea79a6f..eabec47f 100644 --- a/public/templates/mpos/register/default.tpl +++ b/public/templates/mpos/register/default.tpl @@ -14,10 +14,12 @@
- - + +

Strength

+ - +

+