1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-22 06:03:27 +02:00

Password Generator/Meter now uses bootstrap css. Password strength improved.

This commit is contained in:
Cameron
2012-12-09 00:50:58 -08:00
parent d162707716
commit 8814055e84
4 changed files with 102 additions and 30 deletions

View File

@@ -716,11 +716,23 @@ class e_form
function password($name, $value = '', $maxlength = 50, $options = array())
{
if($options['generate'])
{
$addon .= '&nbsp;<a href="#" class="smalltext" id="Spn_PasswordGenerator" >Generate</a> | <a class="smalltext" href="#" id="showPwd">Show</a><br />';
}
if($options['strength'])
{
$addon .= "<div><div id='pwdColor' class='progress' style='float:left;display:inline-block;width:215px'><div class='bar' id='pwdMeter' style='width:0%' ></div></div> <div id='pwdStatus' class='smalltext' style='float:left;display:inline-block;width:150px;margin-left:5px'></span></div>";
}
$options = $this->format_options('text', $name, $options);
$options['class'] = vartrue($options['class'],'e-password');
//never allow id in format name-value for text fields
return "<input type='password' name='{$name}' value='{$value}' maxlength='{$maxlength}'".$this->get_attributes($options, $name)." />";
$text = "<input type='password' name='{$name}' value='{$value}' maxlength='{$maxlength}'".$this->get_attributes($options, $name)." />";
return $text.$addon;
}
// autoexpand done