3 # Display anonymous FTP options
5 require './wuftpd-lib.pl';
6 &ui_print_header(undef, $text{'anon_title'}, "", "anon");
8 $conf = &get_ftpaccess();
9 @class = &find_value("class", $conf);
11 if (!getpwnam("ftp")) {
12 print "<b>$text{'anon_eftp'}</b> <p>\n";
15 print "<form action=save_anon.cgi>\n";
16 print "<table border width=100%>\n";
17 print "<tr $tb> <td><b>$text{'anon_header'}</b></td> </tr>\n";
18 print "<tr $cb> <td><table width=100%>\n";
20 # Display anonymous-root options
21 @root = ( &find_value('anonymous-root', $conf), [ ] );
22 print "<tr> <td valign=top><b>$text{'anon_root'}</b></td>\n";
23 print "<td colspan=3><table border>\n";
24 print "<tr $tb> <td><b>$text{'anon_dir'}</b></td>\n",
25 "<td><b>$text{'anon_class'}</b></td> </tr>\n";
29 printf "<td><input name=dir_$i size=35 value='%s'> %s</td>\n",
30 $r->[0], &file_chooser_button("dir_$i", 1);
31 print "<td><select name=class_$i>\n";
32 printf "<option value='' %s>%s\n",
33 $r->[1] ? '' : 'selected', $text{'anon_any'};
35 printf "<option %s>%s\n",
36 $r->[1] eq $c->[0] ? 'selected' : '', $c->[0];
38 print "</select></td> </tr>\n";
41 print "</table></td> </tr>\n";
43 # Display guest-root options
44 @root = ( &find_value('guest-root', $conf), [ ] );
45 print "<tr> <td valign=top><b>$text{'anon_groot'}</b></td>\n";
46 print "<td colspan=3><table border>\n";
47 print "<tr $tb> <td><b>$text{'anon_dir'}</b></td>\n",
48 "<td><b>$text{'anon_uids'}</b></td> </tr>\n";
52 printf "<td><input name=gdir_$i size=35 value='%s'> %s</td>\n",
53 $r->[0], &file_chooser_button("gdir_$i", 1);
54 printf "<td><input name=uids_$i size=20 value='%s'> %s</td>\n",
55 join(" ", @$r[1..@$r-1]),
56 &user_chooser_button("uids_$i", 1);
60 print "</table></td> </tr>\n";
62 print "<tr> <td colspan=4><hr></td> </tr>\n";
64 # Display autogroup options
65 @auto = ( &find_value('autogroup', $conf), [ ] );
66 print "<tr> <td valign=top><b>$text{'anon_auto'}</b></td>\n";
67 print "<td colspan=3><table border>\n";
68 print "<tr $tb> <td><b>$text{'anon_group'}</b></td>\n",
69 "<td><b>$text{'anon_classes'}</b></td> </tr>\n";
73 map { $aclass{$_}++ } @$a[1..@$a-1];
75 print "<td><input name=agroup_$i size=8 value='$a->[0]'> ",
76 &group_chooser_button("agroup_$i"),"</td>\n";
79 printf "<input name=aclass_$i type=checkbox %s value=%s> %s\n",
80 $aclass{$c->[0]} ? 'checked' : '', $c->[0], $c->[0];
82 print "</td> </tr>\n";
85 print "</table></td> </tr>\n";
86 print "<tr> <td colspan=4><hr></td> </tr>\n";
88 # Display passwd-check field
89 $p = &find_value('passwd-check', $conf);
90 print "<tr> <td><b>$text{'anon_passwd'}</b></td> <td colspan=3>\n";
91 printf "<input type=radio name=passwd_def value=1 %s> %s\n",
92 $p ? '' : 'checked', $text{'default'};
93 printf "<input type=radio name=passwd_def value=0 %s>\n",
95 print "<select name=level>\n";
96 foreach $l ('none', 'trivial', 'rfc822') {
97 printf "<option %s value='%s'>%s\n",
98 $p->[0] eq $l ? 'selected' : '', $l, $text{"anon_$l"};
100 print "</select> <select name=action>\n";
101 foreach $a ('enforce', 'warn') {
102 printf "<option %s value='%s'>%s\n",
103 $p->[1] eq $a ? 'selected' : '', $a, $text{"anon_$a"};
105 print "</select></td> </tr>\n";
107 print "<tr> <td><b>$text{'anon_email'}</b></td>\n";
108 printf "<td colspan=3><input name=email size=50 value='%s'></td> </tr>\n",
109 join(" ", map { $_->[0] } &find_value('deny-email', $conf));
111 print "</table></td></tr></table>\n";
112 print "<input type=submit value=\"$text{'save'}\"></form>\n";
114 &ui_print_footer("", $text{'index_return'});