Diff for /loncom/configuration/SSL.pm between versions 1.3 and 1.4

version 1.3, 2016/08/01 18:03:53 version 1.4, 2016/08/07 04:18:21
Line 35  use Apache::lonlocal(); Line 35  use Apache::lonlocal();
 use Apache::lonnet();  use Apache::lonnet();
 use Apache::loncommon();  use Apache::loncommon();
 use Apache::lonhtmlcommon();  use Apache::lonhtmlcommon();
   use DateTime;
   use DateTime::Format::x509;
 use LONCAPA;   use LONCAPA; 
   
 sub print_certstatus {  sub print_certstatus {
Line 57  sub print_certstatus { Line 59  sub print_certstatus {
                  'host'     => 'Connections Certificate',                   'host'     => 'Connections Certificate',
                  'hostname' => 'Replication Certificate',                   'hostname' => 'Replication Certificate',
                  'ca'       => 'LON-CAPA CA Certificate',                   'ca'       => 'LON-CAPA CA Certificate',
                    'expired'  => 'Expired',
                    'future'   => 'Future validity',
     );      );
     my @files = qw(key host hostname ca);      my @files = qw(key host hostname ca);
     my @fields = qw(status cn start end alg size email);      my @fields = qw(status cn start end alg size email);
Line 83  sub print_certstatus { Line 87  sub print_certstatus {
                     $message .= $file.'=';                      $message .= $file.'=';
                 }                  }
                 if (ref($hashref->{$file}) eq 'HASH') {                  if (ref($hashref->{$file}) eq 'HASH') {
                       my ($starttime,$endtime,$dateinvalid);
                     if ($target eq 'web') {                      if ($target eq 'web') {
                         $message .= '<td>'.$lt{'yes'}.'</td>';                          $message .= '<td>'.$lt{'yes'}.'</td>';
                     } else {                      } else {
                         $message .= $lt{'yes'}.',';                          $message .= $lt{'yes'}.',';
                     }                      }
                       unless ($file eq 'key') {
                           if ($hashref->{$file}->{'end'} ne '') {
                               my $dt = DateTime::Format::x509->parse_datetime($hashref->{$file}->{'end'});
                               if (ref($dt)) {
                                   $endtime = $dt->epoch;
                                   if ($endtime < time) {
                                       $dateinvalid = $lt{'expired'};
                                   }
                               }
                           }
                           if ($hashref->{$file}->{'start'} ne '') {
                               my $dt = DateTime::Format::x509->parse_datetime($hashref->{$file}->{'start'});
                               if (ref($dt)) {
                                   $starttime = $dt->epoch;
                                   if ($starttime > time) {
                                       unless ($dateinvalid) {
                                           $dateinvalid = $lt{'future'};
                                       }
                                   }
                               }
                           }
                       }
                     foreach my $item (@fields) {                      foreach my $item (@fields) {
                         my $display = $hashref->{$file}->{$item};                          my $display = $hashref->{$file}->{$item};
                         if ($target eq 'web') {                          if ($item eq 'status') {
                             if ($item eq 'status') {                              if ($file eq 'key') {
                                 $display = &Apache::lonhtmlcommon::confirm_success($display);                                  if ($display =~ /ok$/) {
                                       if ($target eq 'web') {
                                           $display = &Apache::lonhtmlcommon::confirm_success($display);
                                       }
                                   }
                               } elsif ($file eq 'ca') {
                                   if ($dateinvalid) {
                                       $display = $dateinvalid;
                                   } elsif ($target eq 'web') {
                                       $display = &Apache::lonhtmlcommon::confirm_success($display);
                                   }
                               } elsif ($display =~ /^ok/) {
                                   if ($dateinvalid) {
                                       $display = $dateinvalid;
                                   } elsif ($target eq 'web') { 
                                       $display = &Apache::lonhtmlcommon::confirm_success($display);
                                   }
                             }                              }
                           } elsif ($item eq 'start') {
                               if ($starttime) {
                                   if ($target eq 'web') {
                                       $display = &Apache::lonlocal::locallocaltime($starttime);
                                   } else {
                                       $display = $starttime;
                                   }
                               }
                           } elsif ($item eq 'end') {
                               if ($endtime) {
                                   if ($target eq 'web') {
                                       $display = &Apache::lonlocal::locallocaltime($endtime);
                                   } else {
                                       $display = $endtime;
                                   }
                               }
                           }
                           if ($target eq 'web') {
                             $message .= "<td>$display</td>";                              $message .= "<td>$display</td>";
                         } else {                          } else {
                             $message .= "$display,";                              $message .= "$display,";
                         }                          }
                     }                      }
   
                 } else {                  } else {
                     if ($target eq 'web') {                      if ($target eq 'web') {
                         $message .= '<td>'.$lt{'no'}.'<td>';                          $message .= '<td>'.$lt{'no'}.'<td>';

Removed from v.1.3  
changed lines
  Added in v.1.4


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