Handle hostnames with upper-case letters
[webmin.git] / wuftpd / edit_misc.cgi
1 #!/usr/local/bin/perl
2 # edit_misc.cgi
3 # Display miscellaneous options
4
5 require './wuftpd-lib.pl';
6 &ui_print_header(undef, $text{'misc_title'}, "", "misc");
7
8 $conf = &get_ftpaccess();
9 @class = &find_value("class", $conf);
10
11 print "<form action=save_misc.cgi>\n";
12 print "<table border>\n";
13 print "<tr $tb> <td><b>$text{'misc_header'}</b></td> </tr>\n";
14 print "<tr $cb> <td><table width=100%>\n";
15
16 # Display ls* options
17 foreach $l ('lslong', 'lsshort', 'lsplain') {
18         $v = &find_value($l, $conf);
19         print "<tr> <td><b>",$text{"misc_$l"},"</b></td> <td colspan=3>\n";
20         printf "<input type=radio name=%s_def value=1 %s> %s\n",
21                 $l, $v ? '' : 'checked', $text{'default'};
22         printf "<input type=radio name=%s_def value=0 %s>\n",
23                 $l, $v ? 'checked' : '';
24         printf "<input name=%s size=30 value='%s'></td> </tr>\n",
25                 $l, join(" ", @$v);
26         }
27
28 # Display shutdown option
29 $s = &find_value('shutdown', $conf);
30 printf "<tr> <td><b>$text{'misc_shutdown'}</b></td> <td colspan=3>\n";
31 printf "<input type=radio name=shutdown_def value=1 %s> %s\n",
32         $s ? '' : 'checked', $text{'misc_none'};
33 printf "<input type=radio name=shutdown_def value=0 %s>\n",
34         $s ? 'checked' : '';
35 printf "<input name=shutdown size=30 value='%s'> %s</td> </tr>\n",
36         $s->[0], &file_chooser_button('shutdown', 0);
37 print "<tr> <td colspan=4><hr></td> </tr>\n";
38
39 # Display nice option
40 @nice = ( &find_value('nice', $conf), [ ] );
41 print "<tr> <td valign=top><b>$text{'misc_nice'}</b></td>\n";
42 print "<td colspan=3><table border>\n";
43 print "<tr $tb> <td><b>$text{'misc_ndelta'}</b></td> ",
44       "<td><b>$text{'misc_class'}</b></td> </tr>\n";
45 $i = 0;
46 foreach $n (@nice) {
47         print "<tr $cb>\n";
48         print "<td><input name=ndelta_$i size=5 value='$n->[0]'></td>\n";
49         print "<td><select name=nclass_$i>\n";
50         printf "<option value='' %s>%s\n",
51                 $n->[1] ? '' : 'checked', $text{'misc_all'};
52         foreach $c (@class) {
53                 printf "<option %s>%s\n",
54                         $n->[1] eq $c->[0] ? 'selected' : '', $c->[0];
55                 }
56         print "</select></td> </tr>\n";
57         $i++;
58         }
59 print "</table></td>\n";
60 print "<tr> <td colspan=4><hr></td> </tr>\n";
61
62 # Display defumask option
63 @umask = ( &find_value('defumask', $conf), [ ] );
64 print "<tr> <td valign=top><b>$text{'misc_defumask'}</b></td>\n";
65 print "<td colspan=3><table border>\n";
66 print "<tr $tb> <td><b>$text{'misc_umask'}</b></td> ",
67       "<td><b>$text{'misc_class'}</b></td> </tr>\n";
68 $i = 0;
69 foreach $u (@umask) {
70         print "<tr $cb>\n";
71         print "<td><input name=umask_$i size=5 value='$u->[0]'></td>\n";
72         print "<td><select name=uclass_$i>\n";
73         printf "<option value='' %s>%s\n",
74                 $u->[1] ? '' : 'checked', $text{'misc_all'};
75         foreach $c (@class) {
76                 printf "<option %s>%s\n",
77                         $u->[1] eq $c->[0] ? 'selected' : '', $c->[0];
78                 }
79         print "</select></td> </tr>\n";
80         $i++;
81         }
82 print "</table></td>\n";
83
84 print "</table></td></tr></table>\n";
85 print "<input type=submit value=\"$text{'save'}\"></form>\n";
86
87 &ui_print_footer("", $text{'index_return'});
88