From: erickson Date: Mon, 22 Dec 2008 15:48:06 +0000 (+0000) Subject: test the patron password against the org unit setting regex if it exists X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8d64d7b8742bd26272ba9b2da05161e1b196f219;p=Evergreen.git test the patron password against the org unit setting regex if it exists git-svn-id: svn://svn.open-ils.org/ILS/trunk@11644 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/skin/default/js/sidebar.js b/Open-ILS/web/opac/skin/default/js/sidebar.js index 7d39671a52..45296e41be 100644 --- a/Open-ILS/web/opac/skin/default/js/sidebar.js +++ b/Open-ILS/web/opac/skin/default/js/sidebar.js @@ -121,7 +121,25 @@ function changePassword() { } } +var pwRegexSetting; function strongPassword(pass, alrt) { + + /* first, let's see if there is a configured regex */ + if(!pwRegexSetting) { + var regex = fetchOrgSettingDefault(G.user.home_ou(), 'global.password_regex'); + if(regex) { + if(pass.match(new RegExp(regex))) { + return true; + } else { + if(alrt) + alert($('pw_not_strong').innerHTML); + return false; + } + } + } + + /* no regex configured, use the default */ + var good = false; do {