Handle hostnames with upper-case letters
[webmin.git] / spam / edit_setup.cgi
1 #!/usr/local/bin/perl
2 # edit_setup.cgi
3 # Display a form for setting up SpamAssassin, either locally or globally
4
5 require './spam-lib.pl';
6 &can_use_check("setup");
7 &ui_print_header(undef, $text{'setup_title'}, "");
8
9 &foreign_require("procmail", "procmail-lib.pl");
10 @pmrcs = &get_procmailrc();
11 $pmrc = $pmrcs[$#pmrcs];
12 if ($module_info{'usermin'}) {
13         print &text('setup_desc_usermin', "<tt>$pmrc</tt>"),"<p>\n";
14         }
15 else {
16         print &text('setup_desc_webmin', "<tt>$pmrc</tt>"),"<p>\n";
17         }
18
19 print &ui_form_start("setup.cgi", "post");
20 print &ui_table_start(undef, undef, 2);
21 print $form_hiddens;
22
23 # Spam destination inputs
24 $mbox = $module_info{'usermin'} ? "mail/spam" : "\$HOME/spam";
25 print &ui_table_row($text{'setup_to'},
26         &ui_radio_table("to", 1,
27           [ [ 0, $text{'setup_null'} ],
28             [ 4, $text{'setup_default'} ],
29             [ 1, $text{'setup_file'},
30                  &ui_textbox("mbox", $mbox, 40) ],
31             [ 2, $text{'setup_maildir'},
32                  &ui_textbox("maildir", "", 40) ],
33             [ 3, $text{'setup_mhdir'},
34                  &ui_textbox("mhdir", "", 40) ],
35             [ 5, $text{'setup_email'},
36                  &ui_textbox("email", "", 40) ] ]));
37
38 # Run mode input
39 if (!$module_info{'usermin'}) {
40         print &ui_table_row($text{'setup_drop'},
41                 &ui_radio("drop", 1, [ [ 1, $text{'setup_drop1'} ],
42                                        [ 0, $text{'setup_drop0'} ] ]));
43         }
44
45 # Message about path
46 if ($module_info{'usermin'}) {
47         $msg = "$text{'setup_rel'}<p>\n";
48         }
49 else {
50         $msg = "$text{'setup_home'}<p>\n";
51         }
52 $msg .= "$text{'setup_head'}<p>\n";
53 print &ui_table_row(undef, $msg, 2);
54
55 print &ui_table_end();
56 print &ui_form_end([ [ undef, $text{'setup_ok'} ] ]);
57
58 &ui_print_footer("", $text{'index_return'});
59