Handle hostnames with upper-case letters
[webmin.git] / spam / edit_simple.cgi
1 #!/usr/local/bin/perl
2 # Show simple body tests
3
4 require './spam-lib.pl';
5 &ReadParse();
6 &set_config_file_in(\%in);
7 &can_use_check("header");
8 &ui_print_header($header_subtext, $text{'simple_title'}, "");
9 $conf = &get_config();
10
11 print "$text{'simple_desc'}<p>\n";
12 &start_form("save_simple.cgi", $text{'simple_header'},
13             "<a href='edit_header.cgi?file=".&urlize($in{'file'}).
14             "&title=".&urlize($in{'title'}).
15             "'>$text{'simple_switch'}</a>");
16
17 # Find the tests we can handle
18 @simples = &get_simple_tests($conf);
19
20 $table = &ui_columns_start([ $text{'simple_name'},
21                           $text{'simple_for'},
22                           $text{'simple_regexp'},
23                           $text{'simple_score'},
24                           $text{'simple_describe'} ], 100);
25 $i = 0;
26 foreach $s (@simples, { }, { }, { }) {
27         $table .= &ui_columns_row([
28                 &ui_textbox("name_$i", $s->{'name'}, 20),
29                 &ui_select("header_$i", $s->{'header'},
30                         [ [ "subject", "Subject: header" ],
31                           [ "from", "From: header" ],
32                           [ "to", "To: header" ],
33                           [ "cc", "Cc: header" ],
34                           [ "received", "Received: header" ],
35                           [ "uri", "URL in message" ],
36                           [ "body", "Message body" ],
37                           [ "full", "Un-decoded body" ] ],
38                         0, 0, $s->{'header'} ? 1 : 0),
39                 "/".&ui_textbox("regexp_$i", $s->{'regexp'}, 25)."/".
40                     &ui_textbox("flags_$i", $s->{'flags'}, 2),
41                 &ui_textbox("score_$i", $s->{'score'}, 5),
42                 &ui_textbox("describe_$i", $s->{'describe'}, 30)
43                 ]);
44         $i++;
45         }
46 $table .= &ui_columns_end();
47 print &ui_table_row(undef, $table, 2);
48
49 &end_form(undef, $text{'save'});
50 &ui_print_footer($redirect_url, $text{'index_return'});
51