#!/usr/local/bin/perl # edit_switch.cgi # Display client service switches require './nis-lib.pl'; &ui_print_header(undef, $text{'switch_title'}, ""); @switch = &get_nsswitch_conf(); print "
\n"; print "\n"; print " ", "\n"; foreach $s (@switch) { local @o = split(/\s+/, $s->{'order'}); $max = @o if (@o > $max); } foreach $s (@switch) { local $sv = $s->{'service'}; print "\n"; print "\n"; } print "
$text{'switch_service'}$text{'switch_order'}
",$text{"desc_$sv"} ? $text{"desc_$sv"} : $s->{'service'}," \n"; if ($s->{'order'} =~ /\[/) { print "\n"; } else { local @o = split(/\s+/, $s->{'order'}); local @sources = (""); if (defined(&switch_sources)) { push(@sources, &switch_sources()); } else { push(@sources, split(/\s+/, $config{'sources'})); } print "\n"; for($i=1; $i<=$max+1; $i++) { print ""; } print "
\n"; } push(@list, $sv); print "
\n"; printf "\n", join(" ", @list); print "
\n"; &ui_print_footer("", $text{'index_return'});