Web: make it possible to have a single password field with "show" checkbox

This commit is contained in:
David Anderson 2017-12-28 01:26:52 -08:00
parent 562c063fa9
commit b49d072c9e
2 changed files with 5 additions and 5 deletions

View File

@ -301,17 +301,17 @@ define('FORM_LEFT_CLASS', 'col-sm-4');
define('FORM_LEFT_OFFSET', 'col-sm-offset-4');
define('FORM_RIGHT_CLASS', 'col-sm-8');
function form_input_text($label, $name, $value='', $type='text', $attrs='') {
function form_input_text($label, $name, $value='', $type='text', $attrs='', $extra='') {
echo sprintf('
<div class="form-group">
<label class="control-label %s">%s</label>
<div class="%s">
<input %s type="%s" class="form-control" name="%s" value="%s">
<input %s type="%s" class="form-control" name="%s" value="%s">%s
</div>
</div>
',
FORM_LEFT_CLASS, $label, FORM_RIGHT_CLASS,
$attrs, $type, $name, $value
$attrs, $type, $name, $value, $extra
);
}

View File

@ -175,8 +175,8 @@ function validate_post_make_user() {
}
$passwd = post_str("passwd");
$passwd2 = post_str("passwd2");
if ($passwd != $passwd2) {
$passwd2 = post_str("passwd2", true);
if ($passwd2 && ($passwd != $passwd2)) {
show_error(tra("New passwords are different"));
}