[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

raeburn raeburn@source.lon-capa.org
Mon, 09 Mar 2009 05:52:59 -0000


raeburn		Mon Mar  9 05:52:59 2009 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  &build_recipient_list()
   - in cases where "contacts" entry in domain configuration has not been updated, need to include lonAdminMail address from loncapa.conf as recipient, if no entry yet for lonstatusmail in domconfig.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.765 loncom/interface/loncommon.pm:1.766
--- loncom/interface/loncommon.pm:1.765	Mon Mar  9 05:25:40 2009
+++ loncom/interface/loncommon.pm	Mon Mar  9 05:52:59 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.765 2009/03/09 05:25:40 raeburn Exp $
+# $Id: loncommon.pm,v 1.766 2009/03/09 05:52:59 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -8876,9 +8876,10 @@
 
 =item * &build_recipient_list()
 
-Build recipient lists for three types of e-mail:
-(a) Error Reports, (b) Package Updates, (c) Help requests, generated by
-lonerrorhandler.pm, CHECKRPMS and lonsupportreq.pm respectively.
+Build recipient lists for four types of e-mail:
+(a) Error Reports, (b) Package Updates, (c) lonstatus warnings/errors
+(d) Help requests, generated by
+lonerrorhandler.pm, CHECKRPMS, loncron, and lonsupportreq.pm respectively.
 
 Inputs:
 defmail (scalar - email address of default recipient), 
@@ -8902,17 +8903,21 @@
     my %domconfig =
          &Apache::lonnet::get_dom('configuration',['contacts'],$defdom);
     if (ref($domconfig{'contacts'}) eq 'HASH') {
-        if (ref($domconfig{'contacts'}{$mailing}) eq 'HASH') {
-            my @contacts = ('adminemail','supportemail');
-            foreach my $item (@contacts) {
-                if ($domconfig{'contacts'}{$mailing}{$item}) {
-                    my $addr = $domconfig{'contacts'}{$item}; 
-                    if (!grep(/^\Q$addr\E$/,@recipients)) {
-                        push(@recipients,$addr);
+        if (exists($domconfig{'contacts'}{$mailing})) {
+            if (ref($domconfig{'contacts'}{$mailing}) eq 'HASH') {
+                my @contacts = ('adminemail','supportemail');
+                foreach my $item (@contacts) {
+                    if ($domconfig{'contacts'}{$mailing}{$item}) {
+                        my $addr = $domconfig{'contacts'}{$item}; 
+                        if (!grep(/^\Q$addr\E$/,@recipients)) {
+                            push(@recipients,$addr);
+                        }
                     }
+                    $otheremails = $domconfig{'contacts'}{$mailing}{'others'};
                 }
-                $otheremails = $domconfig{'contacts'}{$mailing}{'others'};
             }
+        } elsif ($origmail ne '') {
+            push(@recipients,$origmail);
         }
     } elsif ($origmail ne '') {
         push(@recipients,$origmail);