set minimal and maximal password length

This commit is contained in:
Dietmar Maurer 2012-01-13 12:04:36 +01:00
parent 0c1563637a
commit fdb30a4cc5

View File

@ -90,7 +90,7 @@ __PACKAGE__->register_method ({
additionalProperties => 0, additionalProperties => 0,
properties => { properties => {
userid => get_standard_option('userid'), userid => get_standard_option('userid'),
password => { type => 'string', optional => 1 }, password => { type => 'string', optional => 1, minLength => 5, maxLength => 64 },
groups => { type => 'string', optional => 1, format => 'pve-groupid-list'}, groups => { type => 'string', optional => 1, format => 'pve-groupid-list'},
firstname => { type => 'string', optional => 1 }, firstname => { type => 'string', optional => 1 },
lastname => { type => 'string', optional => 1 }, lastname => { type => 'string', optional => 1 },
@ -125,7 +125,7 @@ __PACKAGE__->register_method ({
if $usercfg->{users}->{$username}; if $usercfg->{users}->{$username};
PVE::AccessControl::domain_set_password($realm, $ruid, $param->{password}) PVE::AccessControl::domain_set_password($realm, $ruid, $param->{password})
if $param->{password}; if defined($param->{password});
my $enable = defined($param->{enable}) ? $param->{enable} : 1; my $enable = defined($param->{enable}) ? $param->{enable} : 1;
$usercfg->{users}->{$username} = { enable => $enable }; $usercfg->{users}->{$username} = { enable => $enable };
@ -200,7 +200,7 @@ __PACKAGE__->register_method ({
additionalProperties => 0, additionalProperties => 0,
properties => { properties => {
userid => get_standard_option('userid'), userid => get_standard_option('userid'),
password => { type => 'string', optional => 1 }, password => { type => 'string', optional => 1, minLength => 5, maxLength => 64 },
groups => { type => 'string', optional => 1, format => 'pve-groupid-list' }, groups => { type => 'string', optional => 1, format => 'pve-groupid-list' },
append => { append => {
type => 'boolean', type => 'boolean',
@ -240,7 +240,7 @@ __PACKAGE__->register_method ({
if !$usercfg->{users}->{$username}; if !$usercfg->{users}->{$username};
PVE::AccessControl::domain_set_password($realm, $ruid, $param->{password}) PVE::AccessControl::domain_set_password($realm, $ruid, $param->{password})
if $param->{password}; if defined($param->{password});
$usercfg->{users}->{$username}->{enable} = $param->{enable} if defined($param->{enable}); $usercfg->{users}->{$username}->{enable} = $param->{enable} if defined($param->{enable});