Handle hostnames with upper-case letters
[webmin.git] / ldap-client / list_switches.cgi
1 #!/usr/local/bin/perl
2 # Show services in nsswitch.conf, with links to edit them
3
4 if (-r 'ldap-client-lib.pl') {
5         require './ldap-client-lib.pl';
6         }
7 else {
8         require './nis-lib.pl';
9         }
10 require './switch-lib.pl';
11 &ui_print_header(undef, $text{'switch_title'}, "",
12                  $module_name eq "nis" ? undef : "switch");
13
14 print &ui_columns_start([ $text{'switch_service'},
15                           $text{'switch_srcs'} ], undef, 0,
16                         [ "nowrap", "nowrap" ]);
17 $conf = &get_nsswitch_config();
18 foreach $s (@$conf) {
19         $srcs = join(", ", map { $text{'order_'.$_->{'src'}} } @{$s->{'srcs'}});
20         $name = $text{'desc_'.$s->{'name'}} || $s->{'name'};
21         print &ui_columns_row([
22                 "<a href='edit_switch.cgi?name=$s->{'name'}'>$name</a>",
23                 $srcs,
24                 ]);
25         }
26 print &ui_columns_end();
27
28 &ui_print_footer("", $text{'index_return'});
29