Handle hostnames with upper-case letters
[webmin.git] / bsdexports / index.cgi
1 #!/usr/local/bin/perl
2 # index.cgi
3 # Display a list of exports
4
5 require './bsdexports-lib.pl';
6 &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1);
7
8 @exp = &list_exports();
9 if (@exp) {
10         print &ui_form_start("delete_exports.cgi", "post");
11         print &select_all_link("d"),"\n";
12         print &select_invert_link("d"),"\n";
13         print "<a href=edit_export.cgi>$text{'index_add'}</a> <br>\n";
14
15         @tds = ( "width=5" );
16         print &ui_columns_start([ "",
17                                   $text{'index_dirs'},
18                                   $text{'index_clients'} ], 100, 0, \@tds);
19         foreach $e (@exp) {
20                 local @cols;
21                 push(@cols, "<a href=\"edit_export.cgi?index=$e->{'index'}\">".
22                             join(" ", @{$e->{'dirs'}})."</a>");
23                 if ($e->{'network'}) {
24                         push(@cols, "$e->{'network'} / $e->{'mask'}");
25                         }
26                 elsif (!$e->{'hosts'}) {
27                         push(@cols, $text{'index_everyone'});
28                         }
29                 else {
30                         push(@cols, join("&nbsp;|&nbsp;", @{$e->{'hosts'}}));
31                         }
32                 print &ui_checked_columns_row(\@cols, \@tds, "d",
33                                               $e->{'index'});
34                 }
35         print &ui_columns_end();
36
37         print &select_all_link("d"),"\n";
38         print &select_invert_link("d"),"\n";
39         print "<a href=edit_export.cgi>$text{'index_add'}</a> <br>\n";
40         print &ui_form_end([ [ "delete", $text{'index_delete'} ] ]);
41         }
42 else {
43         print "<b>$text{'index_none'}</b> <p>\n";
44         print "<a href=edit_export.cgi>$text{'index_add'}</a> <p>\n";
45         }
46
47 print &ui_hr();
48
49 print &ui_buttons_start();
50 print &ui_buttons_row("restart_mountd.cgi",
51                       $text{'index_apply'},
52                       $text{'index_applydesc'});
53 print &ui_buttons_end();
54
55 &ui_print_footer("/", $text{'index'});
56
57