4 require './dfs-lib.pl';
5 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, 0,
6 &help_search_link("dfstab share", "man"));
8 @shlist = &list_shares();
9 if (@shlist && $access{'icons'}) {
10 # Display shares as icons
11 print "<a href=\"edit_share.cgi\">$text{'index_add'}</a><br>\n";
12 foreach $s (@shlist) {
13 next if ($s->{'type'} ne 'nfs');
14 push(@icons, "images/share.gif");
15 push(@titles, $s->{'dir'});
16 push(@links, "edit_share.cgi?$s->{'index'}");
18 &icons_table(\@links, \@titles, \@icons);
19 if (!$access{'view'}) {
20 print "<a href=\"edit_share.cgi\">$text{'index_add'}</a><br>\n";
24 # Display shares as table
25 if (!$access{'view'}) {
26 print &ui_form_start("delete_shares.cgi", "post");
27 print &select_all_link("d"),"\n";
28 print &select_invert_link("d"),"\n";
29 print "<a href=\"edit_share.cgi\">$text{'index_add'}</a><br>\n";
32 print &ui_columns_start([
33 $access{'view'} ? ( ) : ( "" ),
35 $text{'index_clients'} ], 100, 0, \@tds);
36 foreach $s (@shlist) {
37 next if ($s->{'type'} ne 'nfs');
38 &parse_options($s->{'opts'});
40 if ($access{'view'}) {
41 push(@cols, &html_escape($s->{'dir'}));
43 elsif (defined($options{'public'})) {
44 push(@cols, "<a href=\"edit_share.cgi?$s->{'index'}\">".
45 &html_escape($s->{'dir'})."</a>");
48 push(@cols, "<a href=\"edit_share.cgi?$s->{'index'}\">". &html_escape($s->{'dir'})."</a>");
51 foreach (split(/:/, $options{"ro"})) { $clients{$_}++; }
52 foreach (split(/:/, $options{"rw"})) { $clients{$_}++; }
53 foreach (split(/:/, $options{"root"})) { $clients{$_}++; }
55 $clients = join(' | ' , sort { $a cmp $b }
56 map { &html_escape($_ =~ /^\@(.*)/ ? "$1.*" : $_) }
58 if (length($clients) > 80) {
59 $clients = substr($clients, 0, 80)."...";
63 $clients = $text{'index_everyone'};
65 push(@cols, $clients);
66 if ($access{'view'}) {
67 print &ui_columns_row(\@cols, \@tds);
70 print &ui_checked_columns_row(\@cols, \@tds, "d",
74 print &ui_columns_end();
75 if (!$access{'view'}) {
76 print &select_all_link("d"),"\n";
77 print &select_invert_link("d"),"\n";
78 print "<a href=\"edit_share.cgi\">$text{'index_add'}</a><br>\n";
79 print &ui_form_end([ [ "delete", $text{'index_delete'} ] ]);
83 print "<b>$text{'index_none'}</b><p>\n";
84 print "<a href=\"edit_share.cgi\">$text{'index_add'}</a><p>\n";
87 if (!$access{'view'}) {
89 print &ui_buttons_start();
90 print &ui_buttons_row("restart_sharing.cgi",
92 $text{'index_applydesc'});
93 print &ui_buttons_end();
96 &ui_print_footer("/", "index");