mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-06-13 21:55:02 +00:00
allow port 0 to use default value
This commit is contained in:
parent
a0492cd61b
commit
af4a8a8522
@ -94,9 +94,9 @@ __PACKAGE__->register_method ({
|
||||
optional => 1,
|
||||
},
|
||||
port => {
|
||||
description => "Server port",
|
||||
description => "Server port. Use '0' if you want to use default settings'",
|
||||
type => 'integer',
|
||||
minimum => 1,
|
||||
minimum => 0,
|
||||
maximum => 65535,
|
||||
optional => 1,
|
||||
},
|
||||
@ -149,6 +149,11 @@ __PACKAGE__->register_method ({
|
||||
$cfg->{$realm}->{$p} = $param->{$p};
|
||||
}
|
||||
|
||||
# port 0 ==> use default
|
||||
if (defined($param->{port}) && !$param->{port}) {
|
||||
delete $cfg->{$realm}->{port};
|
||||
}
|
||||
|
||||
cfs_write_file($domainconfigfile, $cfg);
|
||||
}, "add auth server failed");
|
||||
|
||||
@ -190,9 +195,9 @@ __PACKAGE__->register_method ({
|
||||
optional => 1,
|
||||
},
|
||||
port => {
|
||||
description => "Server port",
|
||||
description => "Server port. Use '0' if you want to use default settings'",
|
||||
type => 'integer',
|
||||
minimum => 1,
|
||||
minimum => 0,
|
||||
maximum => 65535,
|
||||
optional => 1,
|
||||
},
|
||||
@ -245,6 +250,11 @@ __PACKAGE__->register_method ({
|
||||
$cfg->{$realm}->{$p} = $param->{$p};
|
||||
}
|
||||
|
||||
# port 0 ==> use default
|
||||
if (defined($param->{port}) && !$param->{port}) {
|
||||
delete $cfg->{$realm}->{port};
|
||||
}
|
||||
|
||||
cfs_write_file($domainconfigfile, $cfg);
|
||||
}, "update auth server failed");
|
||||
|
||||
|
@ -552,7 +552,7 @@ my $valid_attributes = {
|
||||
server1 => '[\w\d]+(.[\w\d]+)*',
|
||||
server2 => '[\w\d]+(.[\w\d]+)*',
|
||||
domain => '\S+',
|
||||
port => '\d*',
|
||||
port => '\d+',
|
||||
secure => '',
|
||||
comment => '.*',
|
||||
},
|
||||
@ -562,7 +562,7 @@ my $valid_attributes = {
|
||||
base_dn => '\w+=[\w\s]+(,\s*\w+=[\w\s]+)*',
|
||||
user_attr => '\S{2,}',
|
||||
secure => '',
|
||||
port => '\d*',
|
||||
port => '\d+',
|
||||
comment => '.*',
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user