Diff for /loncom/interface/lonsupportreq.pm between versions 1.44 and 1.45

version 1.44, 2007/09/05 05:46:19 version 1.45, 2007/12/04 04:43:21
Line 171  END Line 171  END
         my ($sec,$grp) = split(/:/,$section);          my ($sec,$grp) = split(/:/,$section);
         $groupid{$sec} = $grp;          $groupid{$sec} = $grp;
     }      }
     my $codedom = $Apache::lonnet::perlvar{'lonDefDomain'};  
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['codedom']);      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['codedom']);
     if (exists($env{'form.codedom'})) {      my $codedom = &get_domain();
         $codedom = $env{'form.codedom'};  
     }  
     my $details_title;      my $details_title;
     if ($codedom) {      if ($codedom) {
         $details_title = '<br />('.$codedom.')';          $details_title = '<br />('.$codedom.')';
Line 197  function initialize_codes() { Line 194  function initialize_codes() {
     return;      return;
 }  }
     |;      |;
     if ($cdom) {  
         $codedom = $cdom;  
     }  
     if ($cnum) {      if ($cnum) {
         $coursecodes{$cnum} = $ccode;          $coursecodes{$cnum} = $ccode;
         if ($ccode eq '') {          if ($ccode eq '') {
Line 450  sub print_request_receipt { Line 444  sub print_request_receipt {
     my @cookievars = ('lonID');      my @cookievars = ('lonID');
   
     my $admin = $Apache::lonnet::perlvar{'lonAdminMail'};      my $admin = $Apache::lonnet::perlvar{'lonAdminMail'};
     my $to =  $Apache::lonnet::perlvar{'lonSupportEMail'};      my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'};
       my $defdom = &get_domain();
       my $to = &Apache::loncommon::build_recipient_list(undef,'helpdeskmail',
                                                         $defdom,$origmail);
     my $from = $admin;      my $from = $admin;
     my $reporttime = &Apache::lonlocal::locallocaltime(time);      my $reporttime = &Apache::lonlocal::locallocaltime(time);
     my @formvars = ('username','email','uname','udom','sourceurl','phone','section','coursecode','title','subject','description','screenshot');      my @formvars = ('username','email','uname','udom','sourceurl','phone','section','coursecode','title','subject','description','screenshot');
Line 547  END Line 544  END
     if ($r->uri eq '/adm/helpdesk') {      if ($r->uri eq '/adm/helpdesk') {
         &print_header($r,$url,'process');          &print_header($r,$url,'process');
     }      }
     if ($to =~ m/^[^\@]+\@[^\@]+$/) {      my $bad_email = 0;
         $r->print('<h3>'.$lt{'asup'}.' '.$to.'</h3>');      if ($to =~ /,/) {
     } else {          my @ok_email; 
         $to = $admin;          foreach my $email (split(/,/,$to)) {
         if ($to =~ m/^[^\@]+\@[^\@]+$/) {              if ($email =~ m/^[^\@]+\@[^\@]+$/) {
             $r->print('<h3>'.$lt{'asup'}.' '.$to.'</h3>');                  push(@ok_email,$email);
               }
           }
           if (@ok_email > 0) {
               $to = join(',',@ok_email);
           } elsif ($admin =~ m/^[^\@]+\@[^\@]+$/) {
               $to = $admin;
         } else {          } else {
             $r->print('              $bad_email = 1;
           }
       } elsif ($to !~ m/^[^\@]+\@[^\@]+$/) {
           if ($admin =~ m/^[^\@]+\@[^\@]+$/) {
               $to = $admin;
           } else {
               $bad_email = 1;
           }
       }
       if ($bad_email) {
           $r->print('
  <h3>'.$lt{'warn'}.'</h3>'.   <h3>'.$lt{'warn'}.'</h3>'.
 &mt('As the e-mail address provided for this LON-CAPA server ([_1]) does not appear to be a valid e-mail address, your support request has <b>not</b> been sent to the LON-CAPA support staff or administrator at your institution.',$to).' '.&mt('Instead a copy has been sent to the LON-CAPA support team at Michigan State University.'));   &mt('As the e-mail address provided for this LON-CAPA server ([_1]) does not appear to be a valid e-mail address, your support request has <b>not</b> been sent to the LON-CAPA support staff or administrator at your institution.',$to).' '.&mt('Instead a copy has been sent to the LON-CAPA support team at Michigan State University.')); 
             $to = 'helpdesk@lon-capa.org';              $to = 'helpdesk@lon-capa.org';
         }      } else {
           $r->print('<h3>'.$lt{'asup'}.' '.$to.'</h3>');
     }      }
     if (defined($env{'form.email'})) {      if (defined($env{'form.email'})) {
         if ($env{'form.email'} =~ m/^[^\@]+\@[^\@]+$/) {          if ($env{'form.email'} =~ m/^[^\@]+\@[^\@]+$/) {
Line 730  Please review the information in "Log-in Line 744  Please review the information in "Log-in
     return;      return;
 }  }
   
   sub get_domain {
       my $codedom;
       if (exists($env{'form.codedom'})) {
           $codedom = $env{'form.codedom'};
       } elsif ($env{'request.course.id'}) {
           $codedom = $env{'course.'.$env{'request.course.id'}.'.domain'};
       } elsif ($env{'request.role.domain'}) {
           $codedom = $env{'request.role.domain'};
       } else {
           $codedom = $Apache::lonnet::perlvar{'lonDefDomain'};
       }
       return $codedom;
   }
   
 1;  1;

Removed from v.1.44  
changed lines
  Added in v.1.45


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>