[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonsupportreq.pm
raeburn
raeburn at source.lon-capa.org
Tue Aug 27 22:17:10 EDT 2019
raeburn Wed Aug 28 02:17:10 2019 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface lonsupportreq.pm
Log:
- For 2.11
Backport 1.93, 1.94 (part)
Index: loncom/interface/lonsupportreq.pm
diff -u loncom/interface/lonsupportreq.pm:1.79.2.6 loncom/interface/lonsupportreq.pm:1.79.2.7
--- loncom/interface/lonsupportreq.pm:1.79.2.6 Mon Aug 12 18:11:42 2019
+++ loncom/interface/lonsupportreq.pm Wed Aug 28 02:17:10 2019
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Helpdesk request form
#
-# $Id: lonsupportreq.pm,v 1.79.2.6 2019/08/12 18:11:42 raeburn Exp $
+# $Id: lonsupportreq.pm,v 1.79.2.7 2019/08/28 02:17:10 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -676,9 +676,6 @@
my $admin = $Apache::lonnet::perlvar{'lonAdminMail'};
my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'};
my $defdom = &get_domain();
- my ($to,$bcc,$addtext) =
- &Apache::loncommon::build_recipient_list(undef,'helpdeskmail',
- $defdom,$origmail);
my $from = $admin;
my %helpform;
my %domconfig =
@@ -896,6 +893,33 @@
}
}
}
+
+ my ($requname,$requdom,$reqemail);
+ foreach my $field ('uname','udom','email') {
+ $env{'form.'.$field} =~ s/^\s+//;
+ $env{'form.'.$field} =~ s/\s+$//;
+ }
+ if ($env{'form.uname'} =~ /^$match_username$/) {
+ $requname = $env{'form.uname'};
+ }
+ if ($env{'form.udom'} =~ /^$match_domain$/) {
+ $requdom = $env{'form.udom'};
+ }
+ if ($env{'form.email'} =~ m/^[^\@]+\@[^\@]+$/) {
+ $reqemail = $env{'form.email'};
+ }
+
+ my $dom_in_effect;
+ unless ($env{'user.domain'} eq 'public') {
+ $dom_in_effect = $env{'user.domain'};
+ }
+ if ($dom_in_effect eq '') {
+ $dom_in_effect = $requdom;
+ }
+ if ($dom_in_effect eq '') {
+ $dom_in_effect = $defdom;
+ }
+
$displaymsg .= '<span class="LC_helpform_receipt_cat">'.
$lt{'date'}.'</span>: '.$reporttime.'<br />'."\n";
@@ -918,6 +942,11 @@
&print_header($r,$url,'process');
}
my $bad_email = 0;
+ my ($to,$bcc,$addtext) =
+ &Apache::loncommon::build_recipient_list(undef,'helpdeskmail',
+ $dom_in_effect,$origmail,
+ $requname,$requdom,
+ $reqemail);
if ($to =~ /,/) {
my @ok_email;
foreach my $email (split(/,/,$to)) {
@@ -955,12 +984,8 @@
}
$r->print(&Apache::loncommon::confirmwrapper($message));
- if (defined($env{'form.email'})) {
- $env{'form.email'} =~ s/^\s+//;
- $env{'form.email'} =~ s/\s+$//;
- if ($env{'form.email'} =~ m/^[^\@]+\@[^\@]+$/) {
- $from = $env{'form.email'};
- }
+ if ($reqemail ne '') {
+ $from = $reqemail;
}
if (defined($env{'form.cc'})) {
More information about the LON-CAPA-cvs
mailing list