#!/usr/local/bin/perl # edit_security.cgi # Show NIS server security options require './nis-lib.pl'; &ui_print_header(undef, $text{'security_title'}, ""); if (&get_server_mode() == 0 || !(&get_nis_support() & 2)) { print "

$text{'security_enis'}

\n"; &ui_print_footer("", $text{'index_return'}); exit; } print "

\n"; print "\n"; print "\n"; print "
$text{'security_header'}
\n"; if ($config{'securenets'}) { print "\n"; print "\n"; } &show_server_security(); print "
$text{'security_nets'}\n"; print " ", "\n"; open(NETS, $config{'securenets'}); while() { s/#.*$//; if (/(\S+)\s+(\S+)/) { push(@nets, [ $1 eq '255.255.255.255' ? 1 : $1 eq 'host' ? 1 : $1 eq '0.0.0.0' ? 2 : 0, $1, $2 ]); } } close(NETS); local $i = 0; foreach $n (@nets, [ -1, "", "" ]) { print "\n"; printf "\n", $n->[0] == 0 ? $n->[1] : ''; printf "\n", $n->[0] == 2 ? "" : $n->[2]; print "\n"; $i++; } print "
$text{'security_mask'}$text{'security_net'}
%s\n", $n->[0] == -1 ? 'checked' : '', $text{'security_none'}; printf " %s\n", $n->[0] == 2 ? 'checked' : '', $text{'security_any'}; printf " %s\n", $n->[0] == 1 ? 'checked' : '', $text{'security_single'}; printf " %s\n", $n->[0] == 0 ? 'checked' : '', $text{'security_mask'}; printf "
\n"; print "
\n"; &ui_print_footer("", $text{'index_return'});