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

raeburn raeburn@source.lon-capa.org
Wed, 11 Feb 2009 15:19:58 -0000


raeburn		Wed Feb 11 15:19:58 2009 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm 
    /loncom	loncron 
  Log:
  Bug 5903.
  Receipt address(es) for loncron status e-mails configurable via Domain Configuration.
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.88 loncom/interface/domainprefs.pm:1.89
--- loncom/interface/domainprefs.pm:1.88	Tue Feb 10 18:01:40 2009
+++ loncom/interface/domainprefs.pm	Wed Feb 11 15:19:54 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.88 2009/02/10 18:01:40 bisitz Exp $
+# $Id: domainprefs.pm,v 1.89 2009/02/11 15:19:54 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1620,7 +1620,7 @@
     my $datatable;
     my @contacts = ('adminemail','supportemail');
     my (%checked,%to,%otheremails);
-    my @mailings = ('errormail','packagesmail','helpdeskmail');
+    my @mailings = ('errormail','packagesmail','lonstatusmail','helpdeskmail');
     foreach my $type (@mailings) {
         $otheremails{$type} = '';
     }
@@ -1640,6 +1640,8 @@
                     }
                     $otheremails{$type} = $settings->{$type}{'others'};
                 }
+            } elsif ($type eq 'lonstatusmail') {
+                $checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" ';
             }
         }
     } else {
@@ -1647,7 +1649,8 @@
         $to{'adminemail'} = $Apache::lonnet::perlvar{'lonAdmEMail'};
         $checked{'errormail'}{'adminemail'} = ' checked="checked" ';
         $checked{'packagesmail'}{'adminemail'} = ' checked="checked" ';
-        $checked{'helpdeskmail'}{'supportemail'} = ' checked="checked" '; 
+        $checked{'helpdeskmail'}{'supportemail'} = ' checked="checked" ';
+        $checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" '; 
     }
     my ($titles,$short_titles) = &contact_titles();
     my $rownum = 0;
@@ -1691,7 +1694,8 @@
                    'adminemail'   => 'Default Server Admin E-mail address',
                    'errormail'    => 'Error reports to be e-mailed to',
                    'packagesmail' => 'Package update alerts to be e-mailed to',
-                   'helpdeskmail' => 'Helpdesk requests to be e-mailed to'
+                   'helpdeskmail' => 'Helpdesk requests to be e-mailed to',
+                   'lonstatusmail' => 'E-mail from nightly status check (warnings/errors)',
                  );
     my %short_titles = &Apache::lonlocal::texthash (
                            adminemail   => 'Admin E-mail address',
@@ -4121,7 +4125,7 @@
     }
     my (%others,%to);
     my @contacts = ('supportemail','adminemail');
-    my @mailings = ('errormail','packagesmail','helpdeskmail');
+    my @mailings = ('errormail','packagesmail','helpdeskmail','lonstatusmail');
     foreach my $type (@mailings) {
         @{$newsetting{$type}} = 
             &Apache::loncommon::get_env_multiple('form.'.$type);
@@ -4166,6 +4170,7 @@
         $default{'errormail'} = 'adminemail';
         $default{'packagesmail'} = 'adminemail';
         $default{'helpdeskmail'} = 'supportemail';
+        $default{'lonstatusmail'} = 'adminemail';
         foreach my $item (@contacts) {
            if ($to{$item} ne $default{$item}) {
               $changes{$item} = 1;
Index: loncom/loncron
diff -u loncom/loncron:1.77 loncom/loncron:1.78
--- loncom/loncron:1.77	Tue Nov  4 21:06:21 2008
+++ loncom/loncron	Wed Feb 11 15:19:57 2009
@@ -2,7 +2,7 @@
 
 # Housekeeping program, started by cron, loncontrol and loncron.pl
 #
-# $Id: loncron,v 1.77 2008/11/04 21:06:21 www Exp $
+# $Id: loncron,v 1.78 2009/02/11 15:19:57 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -587,7 +587,10 @@
 
 sub send_mail {
     print "sending mail\n";
-    my $emailto="$perlvar{'lonAdmEMail'}";
+    my $defdom = $perlvar->{'lonDefDomain'};
+    my $origmail = $perlvar->{'lonAdmEMail'};
+    my $emailto = &Apache::loncommon::build_recipient_list(undef,
+                                   'lonstatusmail',$defdom,$origmail);
     if ($totalcount>2500) {
 	$emailto.=",$perlvar{'lonSysEMail'}";
     }