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