Handle hostnames with upper-case letters
[webmin.git] / spam / edit_user.cgi
1 #!/usr/local/bin/perl
2 # edit_user.cgi
3 # Display other misc user-level options
4
5 require './spam-lib.pl';
6 &ReadParse();
7 &set_config_file_in(\%in);
8 &can_use_check("user");
9 &ui_print_header($header_subtext, $text{'user_title'}, "");
10 $conf = &get_config();
11
12 print "$text{'user_desc'}<p>\n";
13 &start_form("save_user.cgi", $text{'user_header'});
14
15 # Do DNS lookups?
16 $dns = lc(&find_value("dns_available", $conf));
17 $dns = "test" if (!$dns && $config{'defaults'});
18 @dnsopts = ( [ 1, $text{'yes'} ],
19              [ 0, $text{'no'} ],
20              !$config{'defaults'} ? ( [ -1, $text{'default'}.
21                                        " (".$text{'user_dnstest'}.")" ] ) : ( ),
22              [ 2, $text{'user_dnslist'} ] );
23 print &ui_table_row($text{'user_dns'},
24         &ui_radio("dns", $dns eq 'yes' ? 1 :
25                          $dns eq 'no' ? 0 :
26                          !$dns ? -1 :
27                          $dns =~ /^test/ ? 2 : 3, \@dnsopts).
28         &ui_textbox("dnslist", $dns =~ /^test:\s*(.*)/ ? $1 : "", 30));
29
30
31 # Use razor?
32 $razor = &find("razor_timeout", $conf);
33 print &ui_table_row($text{'user_razor'},
34         &opt_field("razor_timeout", $razor, 5, 10));
35
36 print &ui_table_hr();
37
38 # DCC command
39 $dcc = &find("dcc_path", $conf);
40 print &ui_table_row($text{'user_dcc'},
41         &opt_field("dcc_path", $dcc, 40, $text{'user_inpath'}, 1)." ".
42         &file_chooser_button("dcc_path", 0));
43
44 # Maximum body size for DCC
45 $bodymax = &find("dcc_body_max", $conf);
46 print &ui_table_row($text{'user_bodymax'},
47         &opt_field("dcc_body_max", $bodymax, 6, 999999));
48
49 # DCC command timeout
50 $timeout = &find("dcc_timeout", $conf);
51 print &ui_table_row($text{'user_timeout'},
52         &opt_field("dcc_timeout", $timeout, 5, 10));
53
54 # DCC fuzl?
55 $fuz1max = &find("dcc_fuz1_max", $conf);
56 print &ui_table_row($text{'user_fuz1max'},
57         &opt_field("dcc_fuz1_max", $fuz1max, 6, 999999));
58
59 $fuz2max = &find("dcc_fuz2_max", $conf);
60 print &ui_table_row($text{'user_fuz2max'},
61         &opt_field("dcc_fuz2_max", $fuz2max, 6, 999999));
62
63 if (!&version_atleast(3)) {
64         # Add DCC header?
65         $dheader = &find("dcc_add_header", $conf);
66         print &ui_table_row($text{'user_dheader'},
67                 &yes_no_field("dcc_add_header", $dheader, 0));
68         }
69
70 print &ui_table_hr();
71
72 # Pyzor command
73 $pyzor = &find("pyzor_path", $conf);
74 print &ui_table_row($text{'user_pyzor'},
75         &opt_field("pyzor_path", $pyzor, 40, $text{'user_inpath'}, 1)." ".
76         &file_chooser_button("pyzor_path", 0));
77
78 # Maximum Pyzor body size
79 $pbodymax = &find("pyzor_body_max", $conf);
80 print &ui_table_row($text{'user_pbodymax'},
81         &opt_field("pyzor_body_max", $pbodymax, 6, 999999));
82
83 # Pyzor command timeout
84 $ptimeout = &find("pyzor_timeout", $conf);
85 print &ui_table_row($text{'user_ptimeout'},
86         &opt_field("pyzor_timeout", $ptimeout, 5, 10));
87
88 # Add Pyzor header?
89 $pheader = &find("pyzor_add_header", $conf);
90 print &ui_table_row($text{'user_pheader'},
91         &yes_no_field("pyzor_add_header", $pheader, 0));
92
93 &end_form(undef, $text{'save'});
94 &ui_print_footer($redirect_url, $text{'index_return'});
95
96