Handle hostnames with upper-case letters
[webmin.git] / mount / nfs_export.cgi
1 #!/usr/local/bin/perl
2 # nfs_export.cgi
3 # Display a list of NFS exports on some host for the user to choose from
4
5 $trust_unknown_referers = 1;
6 require './mount-lib.pl';
7 &ReadParse();
8 &popup_header(&text('nfs_choose', &html_escape($in{'server'})));
9 print <<EOF;
10 <script>
11 function choose(f)
12 {
13 top.opener.ifield.value = f;
14 window.close();
15 }
16 </script>
17 EOF
18
19 if ($error = &exports_list($in{'server'}, \@dirs, \@clients)) {
20         print "<b>",&text('nfs_failed', &html_escape($in{'server'}),
21                           "<p><tt>$error</tt><p>"),"</b>\n";
22         exit;
23         }
24 print "<b>$text{'nfs_seldir'}</b>\n";
25 if (defined(&nfs_max_version) && &nfs_max_version($in{'server'}) >= 4) {
26         print "<br>$text{'nfs_seldirv4'}\n";
27         }
28
29 print "<table border width=100%>\n";
30 print "<tr $tb> <td><b>$text{'nfs_dir'}</b></td> ",
31       "<td><b>$text{'nfs_clients'}</b></td> </tr>\n";
32 for($i=0; $i<@dirs; $i++) {
33         print "<tr $cb>\n";
34         print "<td><a href=\"\" onClick='choose(\"$dirs[$i]\"); return false'>",
35               "$dirs[$i]</a></td>\n";
36         printf "<td>%s</td>\n",
37                 length($clients[$i]) > 45 ?
38                         &html_escape(substr($clients[$i], 0, 45))." ..." :
39                         &html_escape($clients[$i]);
40         print "</tr>\n";
41         }
42 print "</table>\n";
43 &popup_footer();