📄 edit_fshare.cgi
字号:
#!/usr/local/bin/perl# edit_fshare.cgi# Display a form for editing or creating a new directory sharerequire './samba-lib.pl';&ReadParse();$s = $in{'share'};if ($s) { if ($s eq "global") { &header("File Share Defaults", ""); } else { &header("Edit File Share", ""); } &get_share($s); }else { &header("Create File Share", ""); }print "<hr>\n";print "<form action=save_fshare.cgi>\n";if ($s) { print "<input type=hidden name=old_name value=\"$s\">\n"; }# Vital share options..print "<table border width=100%>\n";print "<tr $tb> <td><b>Share Information</b></td> </tr>\n";print "<tr $cb> <td><table cellpadding=2>\n";if ($s ne "global") { if ($copy = &getval("copy")) { print "<tr> <td colspan=4><b>This share is a copy of ", "<i>$copy</i></b></td> </tr>\n"; } print "<tr> <td align=right><b>Share name</b></td>\n"; printf "<td colspan=3><input type=radio name=homes value=0 %s>\n", $s eq "homes" ? "" : "checked"; printf "<input size=10 name=share value=\"%s\"> \n", $s eq "homes" ? "" : $s; printf "<input type=radio name=homes value=1 %s> Home Directories Share\n", $s eq "homes" ? "checked" : ""; print "</td> </tr>\n"; }print "<tr> <td align=right><b>Directory to share</b></td>\n";printf "<td colspan=3><input name=path size=40 value=\"%s\">\n", &getval("path");print &file_chooser_button("path", 1);print "</td> </tr>\n";print "<tr> <td align=right><b>Available?</b></td>\n";print "<td>",&yesno_input("available"),"</td>\n";print "<td align=right><b>Browseable?</b></td>\n";print "<td>",&yesno_input("browseable"),"</td> </tr>\n";print "<td align=right><b>Share Comment</b></td>\n";printf "<td colspan=3><input size=40 name=comment value=\"%s\"></td> </tr>\n", &getval("comment");print "</table> </td></tr></table><p>\n";if ($s eq "global") { print "<input type=submit value=Save> </form>\n"; }elsif ($s) { print "<table width=100%> <tr>\n"; print "<td align=left><input type=submit value=Save></td>\n"; print "</form><form action=view_users.cgi>\n"; print "<input type=hidden name=share value=\"$s\">\n"; print "<td align=center><input type=submit value=\"View Connections\"></td>\n"; print "</form><form action=delete_share.cgi>\n"; print "<input type=hidden name=share value=\"$s\">\n"; print "<td align=right><input type=submit value=Delete></td>\n"; print "</form> </tr> </table>\n"; }else { print "<input type=submit value=Create> </form>\n"; }if ($s) { # Icons for other share options $us = "share=".&urlize($s); print "<hr>\n"; print "<h3>Other Share Options</h3>\n"; &icons_table( [ "edit_sec.cgi?$us", "edit_fperm.cgi?$us", "edit_fname.cgi?$us", "edit_fmisc.cgi?$us" ], [ "Security and Access Control", "File Permissions", "File Naming", "Miscellaneous Options" ], [ "images/icon_2.gif", "images/icon_7.gif", "images/icon_8.gif", "images/icon_4.gif" ] ); }print "<hr>\n";&footer("", "share list");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -