diff --git a/src/ppolicy/js/ppolicy.js b/src/ppolicy/js/ppolicy.js index 1d3a663..14af947 100644 --- a/src/ppolicy/js/ppolicy.js +++ b/src/ppolicy/js/ppolicy.js @@ -5,6 +5,7 @@ ltbComponent = $("#ltb-component").text(); entropyPath = new Map([["ssp", "?action=checkentropy"], ["sd", "?page=checkentropy"]]); + loginField = new Map([["ssp", "#login"], ["sd", "#info_identifier td"]]); bootstrapClasses = new Map([["Err", "bg-danger"], ["0", "bg-danger"], ["1", "bg-warning"], ["2", "bg-info"], ["3", "bg-primary"], ["4", "bg-success"]]); @@ -195,9 +196,17 @@ } if (local_policy.pwd_diff_login && local_policy.pwd_diff_login == true) { - if( $( "#login" ).length ) + loginElement = $( loginField.get(ltbComponent) ); + if(loginElement.is("input")) + { + login = loginElement.val().trim(); + } + else + { + login = loginElement.text().trim(); + } + if( login.length ) { - login = $( "#login" ).val(); report( password != login, 'ppolicy-pwd_diff_login-feedback'); } else