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