#!/usr/local/bin/perl # index.cgi # Display a list of directories and their client(s) $| = 1; require './exports-lib.pl'; &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1); if (!&has_nfs_commands()) { print "

",$text{'index_eprog'},"

\n"; &ui_print_footer("/", $text{'index'}); exit; } @exps = &list_exports(); if (@exps) { @dirs = &unique(map { $_->{'dir'} } @exps); if ($access{'icons'}) { # Display icons for exports foreach $d (@dirs) { @cl = grep { $_->{'dir'} eq $d } @exps; foreach $c (@cl) { push(@icons, "images/export.gif"); local $desc = &describe_host($c->{'host'}); if ($c->{'active'}) { push(@titles, $d.'
'.$desc); } else { push(@titles, ''. $d.'
'.$desc.'
'); } push(@links, "edit_export.cgi?idx=$c->{'index'}"); } } &icons_table(\@links, \@titles, \@icons); } else { # Display table of exports and clients print "\n"; print " ", "\n"; foreach $d (@dirs) { print "\n"; print "\n"; } print "
$text{'index_dir'}$text{'index_to'}
$d\n"; @cl = grep { $_->{'dir'} eq $d } @exps; $ccount = 0; foreach $c (@cl) { print " |  " if ($ccount++); print "{'index'}\">",&describe_host($c->{'host'}),"\n"; print "($text{'index_inactive'})","\n" if (!$c->{'active'}); } print "
\n"; } } else { print "$text{'index_none'}

\n"; } print "$text{'index_add'}

\n"; print &ui_hr(); print "\n"; print "\n"; print "\n"; print "
\n"; print "\n"; print "
$text{'index_applymsg'}
\n"; &ui_print_footer("/", $text{'index'});