Handle hostnames with upper-case letters
[webmin.git] / feedback_form.cgi
1 #!/usr/local/bin/perl
2 # feedback_form.cgi
3 # Display a form so that the user can send in a webmin bug report
4
5 BEGIN { push(@INC, ".."); };
6 use WebminCore;
7
8 &init_config();
9 if (&get_product_name() eq 'usermin') {
10         &switch_to_remote_user();
11         }
12 &ReadParse();
13 &error_setup($text{'feedback_err'});
14 %access = &get_module_acl();
15 $access{'feedback'} || &error($text{'feedback_ecannot'});
16 &ui_print_header(undef, $text{'feedback_title'}, "", undef, 0, 1);
17
18 %minfo = &get_module_info($in{'module'}) if ($in{'module'});
19 $fb = $gconfig{'feedback_to'} ||
20       $minfo{'feedback'} ||
21       $webmin_feedback_address;
22 print &text('feedback_desc', "<tt>$fb</tt>"),"<p>\n";
23 print "<b>$text{'feedback_desc2'}</b><p>\n" if (!$gconfig{'feedback_to'});
24
25 print "<form action=feedback.cgi method=post enctype=multipart/form-data>\n";
26 print "<table border width=100%>\n";
27 print "<tr $tb> <td><b>$text{'feedback_header'}</b></td> </tr>\n";
28 print "<tr $cb> <td><table width=100%>\n";
29
30 print "<tr> <td><b>$text{'feedback_name'}</b></td>\n";
31 print "<td><input name=name size=25 value='$gconfig{'feedback_name'}'></td>\n";
32
33 print "<td><b>$text{'feedback_email'}</b></td>\n";
34 print "<td><input name=email size=25 value='$gconfig{'feedback_email'}'></td> </tr>\n";
35
36 print "<tr> <td><b>$text{'feedback_module'}</b></td>\n";
37 print "<td><select name=module>\n";
38 printf "<option value='' %s>%s\n",
39         $in{'module'} ? "" : "selected", $text{'feedback_all'};
40 @modules = ( );
41 foreach $minfo (&get_all_module_infos()) {
42         if (&check_os_support($minfo) &&
43             ($minfo->{'longdesc'} || $minfo->{'feedback'})) {
44                 push(@modules, $minfo);
45                 }
46         }
47 foreach $m (sort { $a->{'desc'} cmp $b->{'desc'} } @modules) {
48         printf "<option %s value=%s>%s\n",
49                 $in{'module'} eq $m->{'dir'} ? "selected" : "",
50                 $m->{'dir'}, $m->{'desc'};
51         }
52 print "</select></td>\n";
53
54 print "<td><b>$text{'feedback_mailserver'}</b></td>\n";
55 printf "<td><input type=radio name=mailserver_def value=1 %s> %s\n",
56         $gconfig{'feedback_mailserver'} ? "" : "checked",
57         $text{'feedback_mailserver_def'};
58 printf "<input type=radio name=mailserver_def value=0 %s>\n",
59         $gconfig{'feedback_mailserver'} ? "checked" : "";
60 printf "<input name=mailserver size=15 value='%s'></td> </tr>\n",
61         $gconfig{'feedback_mailserver'};
62
63 if (!$gconfig{'nofeedbackcc'}) {
64         print "<tr> <td valign=top><b>$text{'feedback_to'}</b></td>\n";
65         print "<td colspan=3><textarea name=to rows=4 cols=50>",
66                 $fb,"</textarea></td> </tr>\n";
67         }
68
69 print "<tr> <td valign=top><b>$text{'feedback_text'}</b></td>\n";
70 print "<td colspan=3><textarea name=text rows=6 cols=70 wrap=on>",
71       "</textarea></td> </tr>\n";
72
73 print "<tr> <td colspan=2 nowrap><b>$text{'feedback_os'}</b>&nbsp;&nbsp;\n";
74 printf "<input type=radio name=os value=1> $text{'yes'}\n";
75 printf "<input type=radio name=os value=0 checked> $text{'no'}</td>\n";
76 print "<td colspan=2>($text{'feedback_osdesc'})</td> </tr>\n";
77
78 if (!$gconfig{'nofeedbackconfig'}) {
79         print "<tr> <td colspan=2 nowrap><b>$text{'feedback_config'}</b>&nbsp;&nbsp;\n";
80         printf "<input type=radio name=config value=1> $text{'yes'}\n";
81         printf "<input type=radio name=config value=0 checked> $text{'no'}</td>\n";
82         print "<td colspan=2>($text{'feedback_configdesc'})</td> </tr>\n";
83         }
84
85 print "<tr> <td><b>$text{'feedback_attach'}</b></td>\n";
86 print "<td><input type=file name=attach0></td>",
87       "<td colspan=2><input type=file name=attach1></td> </tr>\n";
88
89 print "</table></td></tr></table>\n";
90 print "<input type=submit value='$text{'feedback_send'}'></form>\n";
91
92 &ui_print_footer("/?cat=$minfo{'category'}", $text{'index'});
93