3 # Display a list of user classes for editing
5 require './wuftpd-lib.pl';
6 &ui_print_header(undef, $text{'class_title'}, "", "class");
7 $conf = &get_ftpaccess();
9 print "<form action=save_class.cgi>\n";
10 print "<table border width=100%>\n";
11 print "<tr $tb> <td><b>$text{'class_header'}</b></td> </tr>\n";
12 print "<tr $cb> <td><table width=100%>\n";
14 @class = ( &find_value("class", $conf), [ ] );
15 print "<tr> <td valign=top><b>$text{'class_class'}</b></td>\n";
16 print "<td colspan=3><table border width=100%>\n";
17 print "<tr $tb> <td><b>$text{'class_name'}</b></td> ",
18 "<td><b>$text{'class_types'}</b></td> ",
19 "<td><b>$text{'class_addrs'}</b></td> </tr>\n";
23 print "<td><input name=class_$i size=10 value='$c->[0]'></td>\n";
25 map { $types{$_}++ } split(/,/, $c->[1]);
26 printf "<td><input type=checkbox name=types_$i value=real %s> %s\n",
27 $types{'real'} ? 'checked' : '', $text{'class_real'};
28 printf "<input type=checkbox name=types_$i value=anonymous %s> %s\n",
29 $types{'anonymous'} ? 'checked' : '', $text{'class_anonymous'};
30 printf "<input type=checkbox name=types_$i value=guest %s> %s</td>\n",
31 $types{'guest'} ? 'checked' : '', $text{'class_guest'};
32 printf "<td><input name=addrs_$i size=30 value='%s'></td>\n",
33 join(" ", @$c[2..@$c-1]);
37 print "</table></td> </tr>\n";
39 print "<tr> <td colspan=4><hr></td> </tr>\n";
40 foreach $g ('guestuser', 'guestgroup', 'realuser', 'realgroup') {
41 print "<tr> <td><b>",$text{"class_$g"},"</b></td> <td colspan=3>\n";
42 printf "<input name=%s size=50 value='%s'> %s</td> </tr>\n",
43 $g, &join_all($g, $conf),
44 $g =~ /user$/ ? &user_chooser_button($g, 1)
45 : &group_chooser_button($g, 1);
48 print "<tr> <td colspan=4><hr></td> </tr>\n";
49 print "<tr> <td><b>",&text('class_ftpusers', "<tt>$config{'ftpusers'}</tt>"),
50 "</b></td> <td colspan=3>\n";
51 open(FTPUSERS, $config{'ftpusers'});
55 push(@ftpusers, $_) if (/\S/);
58 printf "<input name=ftpusers size=40 value='%s'> %s</td> </tr>\n",
59 join(" ", @ftpusers), &user_chooser_button('ftpusers', 1);
60 foreach $g ('deny-uid', 'deny-gid', 'allow-uid', 'allow-gid') {
61 ($fg = $g) =~ s/-/_/g;
62 print "<tr> <td><b>",$text{"class_$fg"},"</b></td> <td colspan=3>\n";
63 printf "<input name=%s size=40 value='%s'> %s</td> </tr>\n",
64 $fg, &join_all($g, $conf),
65 $g =~ /uid$/ ? &user_chooser_button($fg, 1)
66 : &group_chooser_button($fg, 1);
69 print "</table></td></tr></table>\n";
70 print "<input type=submit value=\"$text{'save'}\"></form>\n";
72 &ui_print_footer("", $text{'index_return'});
74 # join_all(name, &config)
78 foreach $v (&find_value($_[0], $_[1])) {
81 return join(" ", @rv);