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,
},
+ domain => {
+ description => "AD domain name",
+ type => 'string',
+ optional => 1,
+ },
base_dn => {
description => "LDAP base domain name",
type => 'string',
if (defined($param->{secure})) {
$cfg->{$realm}->{secure} = $param->{secure} ? 1 : 0;
}
-
+
if ($param->{default}) {
foreach my $r (keys %$cfg) {
delete $cfg->{$r}->{default};
foreach my $p (keys %$param) {
next if $p eq 'realm';
- $cfg->{$realm}->{$p} = $param->{$p};
+ $cfg->{$realm}->{$p} = $param->{$p} if $param->{$p};
+ }
+
+ # port 0 ==> use default
+ # server2 == '' ===> delete server2
+ for my $p (qw(port server2)) {
+ if (defined($param->{$p}) && !$param->{$p}) {
+ delete $cfg->{$realm}->{$p};
+ }
}
cfs_write_file($domainconfigfile, $cfg);
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,
},
+ domain => {
+ description => "AD domain name",
+ type => 'string',
+ optional => 1,
+ },
base_dn => {
description => "LDAP base domain name",
type => 'string',
}
foreach my $p (keys %$param) {
- $cfg->{$realm}->{$p} = $param->{$p};
+ if ($param->{$p}) {
+ $cfg->{$realm}->{$p} = $param->{$p};
+ } else {
+ delete $cfg->{$realm}->{$p};
+ }
}
cfs_write_file($domainconfigfile, $cfg);