📄 edit_export.cgi
字号:
#!/usr/local/bin/perl# edit_export.cgi# Edit an existing exported directory, or create a new one.require './hpuxexports-lib.pl';$e = $ARGV[0];if ($e) { &header("Edit Export", ""); }else { &header("Create Export", ""); }print "<hr>\n";print "<form action=\"save_export.cgi\">\n";if ($e) { print "<input type=hidden name=old value=\"$e\">\n"; @einfo = &get_exports($e); }print "<table border width=100%><tr $cb><td><table width=100%>\n";print "<tr> <td><b>Directory</b></td>\n";print "<td><input size=40 name=directory value=\"$einfo[0]\">\n";print &file_chooser_button("directory", 1);print "</td>\n";print "</table></td></tr></table><p>\n";print "<table width=100% border>\n";&parse_options($einfo[1]);print "<tr $tb> <td><b>User Access</b></td>\n";print "<td><b>Root Access</b></td> </tr>\n";$fn = "<font size=-1>"; $efn = "</font>";printf "<tr $cb><td><input type=radio name=user value=1 %s> Listed hosts read access<br>\n", defined($options{"ro"}) && $options{"access"} ne "" ? "checked" : "";printf "<input type=radio name=user value=2 %s> All hosts read access<br>\n", defined($options{"ro"}) && !defined($options{"access"}) ? "checked" : "";printf "<input type=radio name=user value=3 %s> All hosts read access, listed hosts write access<br>\n", $options{"rw"} ne "" ? "checked" : "";printf "<input type=radio name=user value=4 %s> Listed hosts write access<br>\n", !defined($options{"ro"}) && $options{"access"} ne "" ? "checked" : "";printf "<input type=radio name=user value=5 %s> All hosts write accesss<br>\n", !defined($options{"ro"}) && !defined($options{"rw"}) && !defined($options{"access"}) ? "checked" : "";print "$fn<textarea name=ualist rows=6 cols=40 >"; if ($options{"rw"} ne "") { $list = join("\n", split(/:/, $options{"rw"})); } if ($options{"access"} ne "") { $list = join("\n", split(/:/, $options{"access"})); } print $list;print "</textarea>$efn</td>\n";printf "<td><input type=radio name=root value=1 %s> None<br>\n", defined($options{"root"}) ? "" : "checked";print "<br>";print "<br>";print "<br>";printf "<input type=radio name=root value=2 %s> Listed hosts<br>\n", $options{"root"} ne "" ? "checked" : "";printf "$fn<textarea name=rtlist rows=6 cols=40 >%s</textarea>$efn</td></tr>\n", join("\n", split(/:/, $options{"root"}));print "</table><p>\n";print "<table border width=100%>\n";print "<tr $tb> <td><b>Export Options</b></td> </tr>\n";print "<tr $cb> <td><table width=100%>\n";if ($e eq "") { $options{"anon"} = 65534; }print "<tr> <td><b>Anonymous User</b></td>\n";print "<td><select name=anon>\n";printf "<option value=\"65534\" %s> Default access\n", $options{"anon"} == 65534 ? "selected" : "";printf "<option value=\"\" %s> No access\n", !defined($options{"anon"}) ? "selected" : "";setpwent();while(@uinfo = getpwent()) { printf "<option value=\"$uinfo[2]\" %s>$uinfo[0]\n", $options{"anon"} == $uinfo[2] ? "selected" : ""; }endpwent();print "</select></td>\n";print "<td><b>Asynchronous Writes</b></td>\n";printf "<td nowrap><input type=radio name=async value=1 %s> Yes\n", defined($options{"async"}) ? "checked" : "";printf "<input type=radio name=nfs_bg value=0 %s> No</td> </tr>\n", defined($options{"async"}) ? "" : "checked";print "</table></td> </tr></table><p>\n";if ($e ne "") { print "<table width=100%>\n"; print "<tr> <td><input type=submit value=Save></td>\n"; print "</form><form action=\"delete_export.cgi\">\n"; print "<input type=hidden name=directory value=\"$e\">\n"; print "<td align=right><input type=submit value=Delete></td> </tr>\n"; print "</form></table><p>\n"; }else { print "<input type=submit value=Create></form><p>\n"; }print "<hr>\n";&footer("", "exports list");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -