3 # Display a form for editing a shared directory
5 require './dfs-lib.pl';
6 $access{'view'} && &error($text{'ecannot'});
10 &ui_print_header(undef, $text{'edit_title1'}, "", "edit_share");
13 &ui_print_header(undef, $text{'edit_title2'}, "", "create_share");
16 print &ui_form_start("save_share.cgi", "post");
18 print &ui_hidden("idx", $s),"\n";
19 @shlist = &list_shares();
23 # Directory and description section
24 print &ui_table_start($text{'edit_header1'}, "width=100%", 2);
26 print &ui_table_row(&hlink($text{'edit_dir'}, "dir"),
27 &ui_textbox("directory", $share->{'dir'}, 60)." ".
28 &file_chooser_button("directory", 1));
30 print &ui_table_row(&hlink($text{'edit_desc'}, "desc"),
31 &ui_textbox("desc", $share->{'desc'}, 60));
33 print &ui_table_end(),"<p>\n";
35 print "<table width=100% border>\n";
36 &parse_options($share->{'opts'});
38 print "<td>",&hlink("<b>$text{'edit_ro'}</b>","ro"),"</td>\n";
39 print "<td>",&hlink("<b>$text{'edit_rw'}</b>","rw"),"</td>\n";
40 print "<td>",&hlink("<b>$text{'edit_root'}</b>","root"),"</td> </tr>\n";
42 # $fn = "<font size=-2>"; $efn = "</font>";
44 print "<td valign=top>",
45 &ui_radio("readonly", !defined($options{"ro"}) ? 0 :
46 $options{"ro"} ? 2 : 1,
47 [ [ 0, $text{'edit_none'}."<br>" ],
48 [ 1, $text{'edit_all'}."<br>" ],
49 [ 2, $text{'edit_listed'}."<br>" ] ])."\n".
50 &ui_textarea("rolist", join("\n", split(/:/, $options{"ro"})), 8, 25),
53 print "<td valign=top>",
54 &ui_radio("readwrite", !defined($options{"rw"}) ? 0 :
55 $options{"rw"} ? 2 : 1,
56 [ [ 0, $text{'edit_none'}."<br>" ],
57 [ 1, $text{'edit_all'}."<br>" ],
58 [ 2, $text{'edit_listed'}."<br>" ] ])."\n".
59 &ui_textarea("rwlist", join("\n", split(/:/, $options{"rw"})), 8, 25),
62 print "<td valign=top>",
63 &ui_radio("root", !defined($options{"root"}) ? 0 :
64 $options{"root"} ? 2 : 1,
65 [ [ 0, $text{'edit_none'}."<br> <br>" ],
66 [ 2, $text{'edit_listed'}."<br>" ] ])."\n".
67 &ui_textarea("rtlist", join("\n", split(/:/, $options{"root"})), 8, 25),
69 print "</tr></table><p>\n";
71 if (!$access{'simple'}) {
72 print &ui_table_start($text{'edit_header2'}, "width=100%", 4);
74 print &ui_table_row(&hlink($text{'edit_nosub'}, "sub"),
75 &ui_radio("nosub", defined($options{"nosub"}) ? 1 : 0,
76 [ [ 0, $text{'yes'} ],
77 [ 1, $text{'no'} ] ]));
79 print &ui_table_row(&hlink($text{'edit_nosuid'}, "suid"),
80 &ui_radio("nosuid", defined($options{"nosuid"}) ? 1 : 0,
81 [ [ 0, $text{'yes'} ],
82 [ 1, $text{'no'} ] ]));
84 print &ui_table_row(&hlink($text{'edit_des'}, "des"),
85 &ui_radio("secure", defined($options{"secure"}) ? 1 : 0,
86 [ [ 1, $text{'yes'} ],
87 [ 0, $text{'no'} ] ]));
89 print &ui_table_row(&hlink($text{'edit_kerberos'}, "kerberos"),
90 &ui_radio("kerberos", defined($options{"kerberos"}) ? 1 : 0,
91 [ [ 1, $text{'yes'} ],
92 [ 0, $text{'no'} ] ]));
94 $user = defined($options{"anon"}) && $options{"anon"} != -1 ?
95 getpwuid($options{'anon'}) : undef;
96 print &ui_table_row(&hlink($text{'edit_anon'}, "anon"),
97 &ui_radio("anon_m", !defined($options{"anon"}) ? 0 :
98 $options{"anon"} == -1 ? 1 : 2,
99 [ [ 0, $text{'edit_anon0'} ],
100 [ 1, $text{'edit_anon1'} ],
101 [ 2, &ui_user_textbox("anon", $user) ] ]));
103 print &ui_table_row(&hlink($text{'edit_aclok'}, "aclok"),
104 &ui_radio("aclok", defined($options{"aclok"}) ? 1 : 0,
105 [ [ 1, $text{'yes'} ],
106 [ 0, $text{'no'} ] ]));
108 if ($gconfig{'os_version'} >= 7) {
109 print &ui_table_row(&hlink($text{'edit_public'}, "public"),
110 &ui_radio("public", defined($options{"public"}) ? 1 : 0,
111 [ [ 1, $text{'yes'} ],
112 [ 0, $text{'no'} ] ]));
114 print &ui_table_row(&hlink($text{'edit_index'}, "index"),
115 &ui_opt_textbox("index", $options{"index"}, 15,
116 $text{'edit_none'}));
119 print &ui_table_end();
123 print &ui_form_end([ [ "save", $text{'save'} ],
124 [ "delete", $text{'delete'} ] ]);
127 print &ui_form_end([ [ "create", $text{'create'} ] ]);
129 &ui_print_footer("", $text{'index_return'});