Delete code and languages related to email feedback feature that is no longer linked to, or useful
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled

This commit is contained in:
Jamie Cameron
2026-05-15 16:51:34 -07:00
parent 60a9bc010c
commit 1a86501e88
8 changed files with 3 additions and 401 deletions

View File

@@ -27,7 +27,7 @@ $main::export_to_caller = 1;
# Add global variables in web-lib.pl
push(@EXPORT, qw(&unique));
push(@EXPORT, qw($config_directory $var_directory $remote_error_handler %month_to_number_map %number_to_month_map $webmin_feedback_address $default_lang $default_charset $module_index_name $module_index_link %in $in @in $progress_callback_prefix $progress_callback_url $wait_for_debug $wait_for_input @matches $theme_no_table $webmin_logfile $pragma_no_cache));
push(@EXPORT, qw($config_directory $var_directory $remote_error_handler %month_to_number_map %number_to_month_map $default_lang $default_charset $module_index_name $module_index_link %in $in @in $progress_callback_prefix $progress_callback_url $wait_for_debug $wait_for_input @matches $theme_no_table $webmin_logfile $pragma_no_cache));
# Functions defined in themes
push(@EXPORT, qw(&theme_post_save_domain &theme_post_save_domains &theme_post_save_server &theme_select_server &theme_select_domain &theme_post_save_folder &theme_post_change_modules &theme_address_button &theme_virtualmin_ui_rating_selector &theme_virtualmin_ui_show_cron_time &theme_virtualmin_ui_parse_cron_time &theme_virtualmin_ui_html_editor_bodytags &theme_virtualmin_ui_show_html_editor &theme_post_change_theme &theme_pre_change_theme &theme_fonts &theme_css_inline &theme_forgot_url &theme_forgot_handler));

View File

@@ -77,11 +77,6 @@ print &ui_table_row($text{'acl_gedit'},
print &ui_table_hr();
# Can submit feedback?
print &ui_table_row($text{'acl_feedback'},
&ui_radio("feedback", int($o->{'feedback'}),
[ map { [ $_, $text{'acl_feedback'.$_} ] } (2,3,1,0) ]));
# Can accept RPC calls?
print &ui_table_row($text{'acl_rpc'},
&ui_radio("rpc", int($o->{'rpc'}),
@@ -127,7 +122,6 @@ $o->{'gedit'} = $in{'gedit_mode'} == 2 ? $in{'gedit_can'} :
$in{'gedit_mode'} == 3 ? $in{'gedit_cannot'} :
$in{'gedit_mode'} == 4 ? $in{'gedit_gid'} : "";
$o->{'gedit2'} = $in{'gedit_mode'} == 4 ? $in{'gedit_gid2'} : undef;
$o->{'feedback'} = $in{'feedback'};
$o->{'rpc'} = $in{'rpc'};
$o->{'negative'} = $in{'negative'};
$o->{'readonly'} = $in{'readonly'};

View File

@@ -1,262 +0,0 @@
#!/usr/local/bin/perl
# Send the webmin feedback form
BEGIN { push(@INC, "."); };
use WebminCore;
&init_config();
if (&get_product_name() eq 'usermin') {
&switch_to_remote_user();
}
&ReadParseMime();
&error_setup($text{'feedback_err'});
%access = &get_module_acl();
$access{'feedback'} || &error($text{'feedback_ecannot'});
# Construct the email body
$in{'text'} =~ s/\r//g;
$date = localtime(time());
$ver = &get_webmin_version();
if ($in{'name'} && $in{'email'}) {
$from = "$in{'name'} <$in{'email'}>";
$email = $in{'email'};
}
elsif ($in{'email'}) {
$email = $from = $in{'email'};
}
else {
$email = $from = "feedback\@".&get_system_hostname();
}
local $m = $in{'module'};
$m || !$in{'config'} || &error($text{'feedback_emodule'});
&check_os_support($m) && $m !~ /\.\./ || &error($text{'feedback_emodule2'});
if ($m) {
%minfo = &get_module_info($m);
$ver .= " (Module: $minfo{'version'})" if ($minfo{'version'});
$module = "$m ($minfo{'desc'})";
}
else {
$module = "None";
}
if ($gconfig{'nofeedbackcc'}) {
@tolist = ( $gconfig{'feedback_to'} ||
$minfo{'feedback'} ||
$webmin_feedback_address );
}
else {
@tolist = split(/\s+/, $in{'to'});
}
@tolist || &error($text{'feedback_enoto'});
foreach $t (@tolist) {
$headers .= "To: $t\n";
}
$headers .= "From: $from\n";
$headers .= "Subject: $text{'feedback_title'}\n";
$attach[0] = <<EOF;
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Name: $in{'name'}
Email address: $in{'email'}
Date: $date
Webmin version: $ver
Perl version: $]
Module: $module
Browser: $ENV{'HTTP_USER_AGENT'}
EOF
if ($in{'os'}) {
$uname = `uname -a`;
$attach[0] .= <<EOF;
OS from webmin: $gconfig{'real_os_type'} $gconfig{'real_os_version'}
OS code: $gconfig{'os_type'} $gconfig{'os_version'}
Uname output: $uname
EOF
}
$attach[0] .= "\n".$in{'text'}."\n";
if ($in{'config'} && !$gconfig{'nofeedbackconfig'}) {
# Check if this user has full rights to the module
$access{'feedback'} >= 2 || &error($text{'feedback_ecannot2'});
local %uacl = &get_module_acl(undef, $m);
local %defacl;
local $mdir = &module_root_directory($m);
&read_file("$mdir/defaultacl", \%defacl);
if ($access{'feedback'} != 3) {
foreach $k (keys %uacl) {
if ($defacl{$k} ne $uacl{$k}) {
&error($text{'feedback_econfig'});
}
}
}
# Attach all the text file from the module's config
local %mconfig = &foreign_config($m);
if (keys %mconfig) {
local $a;
$a .= "Content-Type: text/plain; name=\"config\"\n";
$a .= "Content-Transfer-Encoding: 7bit\n";
$a .= "\n";
foreach $k (keys %mconfig) {
$a .= "$k=$mconfig{$k}\n";
}
push(@attach, $a);
}
# Find out what config files the module uses
local @files;
if (-r "$mdir/feedback_files.pl") {
# Ask the module for it's files
&foreign_require($m, "feedback_files.pl");
@files = &foreign_call($m, "feedback_files", $m);
}
# Use all the path in the config
foreach $k (keys %mconfig) {
push(@files, $mconfig{$k}) if ($mconfig{$k} =~ /^\//);
}
@files = &unique(@files);
# Attach those config files that are plain text (less than 5%
# non-ascii characters). Also skip logfiles.
foreach $f (@files) {
next if (!$f || -d $f);
next if ($f =~ /\/var\/log\//);
local $/ = undef;
open(FILE, "<$f") || next;
local $data = <FILE>;
close(FILE);
local $count = ($data =~ tr/[\000-\176]/[\000-\176]/);
if (!length($data) || 100*$count / length($data) > 95) {
# File is text
local $a;
local $sf = &short_name($f);
$a .= "Content-Type: text/plain; name=\"$sf\"\n";
$a .= "Content-Transfer-Encoding: 7bit\n";
$a .= "\n";
$a .= $data;
push(@attach, $a);
}
}
}
# Include uploaded attached files
foreach $u ('attach0', 'attach1') {
if ($in{$u} ne '') {
local $a;
local $name = &short_name($in{"${u}_filename"});
local $type = $in{"${u}_content_type"};
$type = &guess_mime_type($name) if (!$type);
$a .= "Content-type: $type; name=\"$name\"\n";
$a .= "Content-Transfer-Encoding: base64\n";
$a .= "\n\n";
$a .= &encode_base64($in{$u});
push(@attach, $a);
}
}
# Build the MIME email
$bound = "bound".time();
$mail = $headers;
$mail .= "Content-Type: multipart/mixed; boundary=\"$bound\"\n";
$mail .= "MIME-Version: 1.0\n";
$mail .= "\n";
$mail .= "This is a multi-part message in MIME format.\n";
foreach $a (@attach) {
$mail .= "\n--".$bound."\n";
$mail .= $a;
}
$mail .= "\n--".$bound."--\n";
if (!$in{'mailserver_def'}) {
$ok = &send_via_smtp($in{'mailserver'});
$sent = 3 if ($ok);
}
if (!$sent) {
# Try to send the email by calling sendmail -t
%sconfig = &foreign_config("sendmail");
$sendmail = $sconfig{'sendmail_path'} ? $sconfig{'sendmail_path'}
: &has_command("sendmail");
if (-x $sendmail && open(MAIL, "| $sendmail -t")) {
print MAIL $mail;
if (close(MAIL)) {
$sent = 2;
}
}
}
if (!$sent) {
# Try to connect to a local SMTP server
$ok = &send_via_smtp("localhost");
$sent = 1 if ($ok);
}
if ($sent) {
# Tell the user that it was sent OK
&ui_print_header(undef, $text{'feedback_title'}, "", undef, 0, 1);
if ($sent == 3) {
print &text('feedback_via', join(",", @tolist),
"<tt>$in{'mailserver'}</tt>"),"\n";
}
elsif ($sent == 2) {
print &text('feedback_prog', join(",", @tolist),
"<tt>$sendmail</tt>"),"\n";
}
else {
print &text('feedback_via', join(",", @tolist),
"<tt>localhost</tt>"),"\n";
}
print "<p>\n";
&ui_print_footer("/", $text{'index'});
# Save settings in config
$gconfig{'feedback_name'} = $in{'name'};
$gconfig{'feedback_email'} = $in{'email'};
$gconfig{'feedback_mailserver'} =
$in{'mailserver_def'} ? undef : $in{'mailserver'};
&write_file("$config_directory/config", \%gconfig);
}
else {
# Give up! Tell the user ..
&error($text{'feedback_esend'});
}
sub send_via_smtp
{
local $error;
&open_socket($_[0], 25, MAIL, \$error);
return 0 if ($error);
&smtp_command(MAIL) || return 0;
&smtp_command(MAIL, "helo ".&get_system_hostname()."\r\n") || return 0;
&smtp_command(MAIL, "mail from: <$email>\r\n") || return 0;
foreach $t (@tolist) {
&smtp_command(MAIL, "rcpt to: <$t>\r\n") || return 0;
}
&smtp_command(MAIL, "data\r\n");
$mail =~ s/\r//g;
$mail =~ s/\n/\r\n/g;
print MAIL $mail;
&smtp_command(MAIL, ".\r\n");
&smtp_command(MAIL, "quit\r\n");
close(MAIL);
return 1;
}
# smtp_command(handle, command)
sub smtp_command
{
local ($m, $c) = @_;
print $m $c;
local $r = <$m>;
return $r =~ /^[23]\d+/;
}
sub short_name
{
$_[0] =~ /([^\\\/]+)$/;
return $1;
}

View File

@@ -1,93 +0,0 @@
#!/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>&nbsp;&nbsp;\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>&nbsp;&nbsp;\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("/", $text{'index'});

35
lang/en
View File

@@ -1,5 +1,4 @@
main_homepage=Home Page
main_feedback=Feedback..
main_switch=Switch user..
main_logout=Logout
main_version=Version $1 on $2 ($3)
@@ -214,11 +213,6 @@ acl_gedit_none=No groups
acl_gedit_only=Only groups
acl_gedit_except=All except groups
acl_gedit_gid=Groups with GIDs in range
acl_feedback=Can send feedback email?
acl_feedback2=Yes
acl_feedback1=Yes, but not with config files
acl_feedback0=No
acl_feedback3=Yes, with config files
acl_rpc=Can accept RPC calls?
acl_rpc2=Only for <tt>root</tt> or <tt>admin</tt>
acl_rpc1=Yes
@@ -280,35 +274,6 @@ skill_high=Expert
skill_medium=Intermediate
skill_low=Novice
feedback_title=Webmin Feedback
feedback_desc=This form allows you to report bugs on make suggestions to the Webmin developers regarding any problems or missing features that you have found. When the Send button is clicked, the details entered into the form will be emailed to $1.
feedback_desc2=This feedback will be sent to the developer of Webmin, not your system administrator, ISP or hosting company. Please write your feedback in english, even if you are currently running Webmin in another language.
feedback_header=Feedback details
feedback_name=Your name
feedback_email=Your email address
feedback_module=Regarding module
feedback_all=All modules
feedback_text=Description of problem or suggestion
feedback_os=Include operating system details in email?
feedback_osdesc=If this option is selected, the automatic feedback email will include your operating system name and version.
feedback_config=Include module configuration in email?
feedback_configdesc=If this is selected, the email will include the configuration of the related module and the contents of any config files that the module uses. For example, if the feedback was related to the <i>Users and Groups</i> module, your <tt>/etc/passwd</tt> and <tt>/etc/shadow</tt> files would be sent.
feedback_attach=Additional files to attach
feedback_send=Send Feedback
feedback_mailserver=Send via SMTP server
feedback_mailserver_def=Local sendmail program
feedback_err=Failed to send feedback
feedback_emodule=You chose to include module configuration in the email, but did not select a module.
feedback_emodule2=Selected module does not exist
feedback_econfig=You do not have full access to the selected module.
feedback_via=Sent feedback to $1 via SMTP server $2
feedback_prog=Sent feedback to $1 using sendmail program $2
feedback_esend=Failed to send feedback via sendmail program or local SMTP server.
feedback_to=Send feedback to addresses
feedback_enoto=No addresses were entered to send feedback to
feedback_ecannot=You are not allowed to send feedback
feedback_ecannot2=You are not allowed to send feedback containing config files
progress_size2=Downloading $1 ($2) ..
progress_nosize=Downloading $1 ..
progress_datan=Received $1 ($2 %)

View File

@@ -43,7 +43,7 @@ $vers || usage();
"defaultacl", "rpc.cgi", "date_chooser.cgi",
"safeacl", "install-module.pl", "LICENCE.ja",
"favicon.ico", "config-netbsd", "fastrpc.cgi",
"defaulttheme", "feedback.cgi", "feedback_form.cgi",
"defaulttheme",
"javascript-lib.pl", "webmin-pam", "webmin-debian-pam", "maketemp.pl",
"run-uninstalls.pl",
"webmin-gentoo-init", "run-postinstalls.pl",

View File

@@ -23,8 +23,7 @@ our $error_handler_funcs = [ ];
use vars qw($loaded_theme_library $wait_for_input
$done_webmin_header $trust_unknown_referers $unsafe_index_cgi
%done_foreign_require $webmin_feedback_address
$pragma_no_cache $foreign_args);
%done_foreign_require $pragma_no_cache $foreign_args);
# Globals
use vars qw($module_index_name $number_to_month_map $month_to_number_map
$umask_already $default_charset $licence_status $os_type

View File

@@ -6,7 +6,6 @@
%number_to_month_map = reverse(%month_to_number_map);
$main::default_debug_log_size = 10*1024*1024;
$webmin_feedback_address = "feedback\@webmin.com";
$default_lang = "en";
$default_charset = "UTF-8";