|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /usr/libexec/webmin/nis/ |
Upload File : |
#!/usr/bin/perl
# save_client.cgi
# Save and apply NIS client options
require './nis-lib.pl';
&ReadParse();
&error_setup($text{'client_err'});
# Parse and validate inputs
if (!$in{'domain_def'}) {
$in{'domain'} =~ /^[A-Za-z0-9\.\-]+$/ ||
&error($text{'client_edomain'});
$nis->{'domain'} = $in{'domain'};
}
if ($in{'broadcast'}) {
$nis->{'broadcast'} = 1;
}
else {
@servers = split(/\s+/, $in{'servers'});
foreach $s (@servers) {
gethostbyname($s) || &check_ipaddress($s) ||
&error(&text('client_eserver', $s));
}
$nis->{'servers'} = \@servers;
}
# Save and apply
$err = &save_client_config($nis);
if ($err) { &error($err); }
&redirect("");