Handle hostnames with upper-case letters
[webmin.git] / apache / edit_gmime_type.cgi
1 #!/usr/local/bin/perl
2 # edit_gmime_type.cgi
3 # Display a form for editing a MIME type from the global list
4
5 require './apache-lib.pl';
6 &ReadParse();
7 $access{'global'}==1 || &error($text{'mime_ecannot'});
8 if (defined($in{'line'})) {
9         &ui_print_header(undef, $text{'mime_edit'}, "");
10         open(MIME, $in{'file'});
11         for($i=0; $i<=$in{'line'}; $i++) {
12                 $line = <MIME>;
13                 }
14         close(MIME);
15         $line =~ s/#.*$//;
16         $line =~ /^\s*(\S+)\s*(.*)$/;
17         $type = $1; @exts = split(/\s+/, $2);
18         }
19 else {
20         &ui_print_header(undef, $text{'mime_add'}, "");
21         }
22
23 print &ui_form_start("save_gmime_type.cgi");
24 print &ui_hidden("file", $in{'file'});
25 if ($type) {
26         print &ui_hidden("line", $in{'line'});
27         }
28 print &ui_table_start($text{'mime_header'}, undef, 2);
29
30 print &ui_table_row($text{'mime_type'},
31         &ui_textbox("type", $type, 40));
32
33 print &ui_table_row($text{'mime_ext'},
34         &ui_textarea("exts", join("\n", @exts), 5, 15));
35
36 print &ui_table_end();
37 print &ui_form_end([ [ "", $text{'save'} ] ]);
38
39 &ui_print_footer("edit_global.cgi?type=6", $text{'global_return'});
40