From 1a86501e880cdcffa8baeb001539192b03576127 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 15 May 2026 16:51:34 -0700 Subject: [PATCH] Delete code and languages related to email feedback feature that is no longer linked to, or useful --- WebminCore.pm | 2 +- acl_security.pl | 6 -- feedback.cgi | 262 ---------------------------------------------- feedback_form.cgi | 93 ---------------- lang/en | 35 ------- makedist.pl | 2 +- web-lib-funcs.pl | 3 +- web-lib.pl | 1 - 8 files changed, 3 insertions(+), 401 deletions(-) delete mode 100755 feedback.cgi delete mode 100755 feedback_form.cgi diff --git a/WebminCore.pm b/WebminCore.pm index 53a04ab9d..f452f094b 100644 --- a/WebminCore.pm +++ b/WebminCore.pm @@ -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)); diff --git a/acl_security.pl b/acl_security.pl index 25937b3cb..0dda36b27 100755 --- a/acl_security.pl +++ b/acl_security.pl @@ -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'}; diff --git a/feedback.cgi b/feedback.cgi deleted file mode 100755 index ba5565b21..000000000 --- a/feedback.cgi +++ /dev/null @@ -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] = <= 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 = ; - 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), - "$in{'mailserver'}"),"\n"; - } - elsif ($sent == 2) { - print &text('feedback_prog', join(",", @tolist), - "$sendmail"),"\n"; - } - else { - print &text('feedback_via', join(",", @tolist), - "localhost"),"\n"; - } - print "

\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; -} - diff --git a/feedback_form.cgi b/feedback_form.cgi deleted file mode 100755 index 8980c0526..000000000 --- a/feedback_form.cgi +++ /dev/null @@ -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', "$fb"),"

\n"; -print "$text{'feedback_desc2'}

\n" if (!$gconfig{'feedback_to'}); - -print "

\n"; -print "\n"; -print "\n"; -print "
$text{'feedback_header'}
\n"; - -print "\n"; -print "\n"; - -print "\n"; -print "\n"; - -print "\n"; -print "\n"; - -print "\n"; -printf "\n", - $gconfig{'feedback_mailserver'}; - -if (!$gconfig{'nofeedbackcc'}) { - print "\n"; - print "\n"; - } - -print "\n"; -print "\n"; - -print "\n"; -print "\n"; - -if (!$gconfig{'nofeedbackconfig'}) { - print "\n"; - print "\n"; - } - -print "\n"; -print "", - "\n"; - -print "
$text{'feedback_name'}$text{'feedback_email'}
$text{'feedback_module'}$text{'feedback_mailserver'} %s\n", - $gconfig{'feedback_mailserver'} ? "" : "checked", - $text{'feedback_mailserver_def'}; -printf "\n", - $gconfig{'feedback_mailserver'} ? "checked" : ""; -printf "
$text{'feedback_to'}
$text{'feedback_text'}
$text{'feedback_os'}  \n"; -printf " $text{'yes'}\n"; -printf " $text{'no'}($text{'feedback_osdesc'})
$text{'feedback_config'}  \n"; - printf " $text{'yes'}\n"; - printf " $text{'no'}($text{'feedback_configdesc'})
$text{'feedback_attach'}
\n"; -print "
\n"; - -&ui_print_footer("/", $text{'index'}); - diff --git a/lang/en b/lang/en index 6293a4ed6..2f9a52cb5 100644 --- a/lang/en +++ b/lang/en @@ -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 root or admin 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 Users and Groups module, your /etc/passwd and /etc/shadow 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 %) diff --git a/makedist.pl b/makedist.pl index 159e9c880..963cc379e 100755 --- a/makedist.pl +++ b/makedist.pl @@ -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", diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index 930906577..114f24033 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -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 diff --git a/web-lib.pl b/web-lib.pl index 3171f7c28..325648769 100755 --- a/web-lib.pl +++ b/web-lib.pl @@ -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";