test the patron password against the org unit setting regex if it exists
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 22 Dec 2008 15:48:06 +0000 (15:48 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 22 Dec 2008 15:48:06 +0000 (15:48 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@11644 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/skin/default/js/sidebar.js

index 7d39671..45296e4 100644 (file)
@@ -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 {