cmd checkpwstrength returns password strengt relative to minimum strength set in configuration

This commit is contained in:
steinm 2012-12-14 07:57:03 +00:00
parent d4d366d5aa
commit 87a8fd2ce0

View File

@ -59,9 +59,9 @@ switch($command) {
$score = $ps->get_score(); $score = $ps->get_score();
if($settings->_passwordStrength) { if($settings->_passwordStrength) {
if($score > $settings->_passwordStrength) { if($score > $settings->_passwordStrength) {
echo json_encode(array('error'=>0, 'strength'=>$score, 'ok'=>1)); echo json_encode(array('error'=>0, 'strength'=>$score, 'score'=>$score/$settings->_passwordStrength, 'ok'=>1));
} else { } else {
echo json_encode(array('error'=>0, 'strength'=>$score, 'ok'=>0)); echo json_encode(array('error'=>0, 'strength'=>$score, 'score'=>$score/$settings->_passwordStrength, 'ok'=>0));
} }
} else { } else {
echo json_encode(array('error'=>0, 'strength'=>$score)); echo json_encode(array('error'=>0, 'strength'=>$score));