Handle hostnames with upper-case letters
[webmin.git] / nis / old_save_switch.cgi
1 #!/usr/local/bin/perl
2 # save_switch.cgi
3 # Save client nsswitch configuration
4
5 require './nis-lib.pl';
6 &ReadParse();
7 &error_setup($text{'switch_err'});
8
9 foreach $sv (split(/\s+/, $in{'list'})) {
10         if (defined($o = $in{"order_$sv"})) {
11                 $o =~ /\S/ ||
12                         &error(&text('switch_eorder', $text{"switch_$sv"}));
13                 &save_nsswitch($sv, $o);
14                 }
15         else {
16                 local @order;
17                 for($i=1; defined($o = $in{"order_${sv}_${i}"}); $i++) {
18                         push(@order, $o) if ($o);
19                         }
20                 &save_nsswitch($sv, join(" ", @order));
21                 }
22         }
23 &flush_file_lines();
24 &redirect("");
25