[LON-CAPA-cvs] cvs: loncom / Lond.pm /configuration SSL.pm
raeburn
raeburn at source.lon-capa.org
Thu May 18 18:13:57 EDT 2017
raeburn Thu May 18 22:13:57 2017 EDT
Modified files:
/loncom Lond.pm
/loncom/configuration SSL.pm
Log:
- Only translate SSL key and certificate status if target is web.
- Include additional status types for SSL certificates (host and hostname)
-- nokey and otherkey -- if key is missing, or certificate uses another
key.
Index: loncom/Lond.pm
diff -u loncom/Lond.pm:1.9 loncom/Lond.pm:1.10
--- loncom/Lond.pm:1.9 Mon Jul 25 19:49:45 2016
+++ loncom/Lond.pm Thu May 18 22:13:52 2017
@@ -1,6 +1,6 @@
# The LearningOnline Network
#
-# $Id: Lond.pm,v 1.9 2016/07/25 19:49:45 raeburn Exp $
+# $Id: Lond.pm,v 1.10 2017/05/18 22:13:52 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -852,6 +852,10 @@
if ($md5hash{$key}) {
if ($md5hash{$key} eq $md5hash{'key'}) {
$info{$key}{'status'} = 'ok';
+ } elsif ($info{'key'}{'status'} =~ /ok/) {
+ $info{$key}{'status'} = 'otherkey';
+ } else {
+ $info{$key}{'status'} = 'nokey';
}
}
}
Index: loncom/configuration/SSL.pm
diff -u loncom/configuration/SSL.pm:1.4 loncom/configuration/SSL.pm:1.5
--- loncom/configuration/SSL.pm:1.4 Sun Aug 7 04:18:21 2016
+++ loncom/configuration/SSL.pm Thu May 18 22:13:57 2017
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Checksum installed LON-CAPA modules and some configuration files
#
-# $Id: SSL.pm,v 1.4 2016/08/07 04:18:21 raeburn Exp $
+# $Id: SSL.pm,v 1.5 2017/05/18 22:13:57 raeburn Exp $
#
# The LearningOnline Network with CAPA
#
@@ -61,6 +61,8 @@
'ca' => 'LON-CAPA CA Certificate',
'expired' => 'Expired',
'future' => 'Future validity',
+ 'nokey' => 'No key',
+ 'otherkey' => 'No matching key',
);
my @files = qw(key host hostname ca);
my @fields = qw(status cn start end alg size email);
@@ -91,7 +93,7 @@
if ($target eq 'web') {
$message .= '<td>'.$lt{'yes'}.'</td>';
} else {
- $message .= $lt{'yes'}.',';
+ $message .= 'yes,';
}
unless ($file eq 'key') {
if ($hashref->{$file}->{'end'} ne '') {
@@ -99,7 +101,11 @@
if (ref($dt)) {
$endtime = $dt->epoch;
if ($endtime < time) {
- $dateinvalid = $lt{'expired'};
+ if ($target eq 'web') {
+ $dateinvalid = $lt{'expired'};
+ } else {
+ $dateinvalid = 'expired';
+ }
}
}
}
@@ -109,7 +115,11 @@
$starttime = $dt->epoch;
if ($starttime > time) {
unless ($dateinvalid) {
- $dateinvalid = $lt{'future'};
+ if ($target eq 'web') {
+ $dateinvalid = $lt{'future'};
+ } else {
+ $dateinvalid = 'future';
+ }
}
}
}
@@ -136,6 +146,10 @@
} elsif ($target eq 'web') {
$display = &Apache::lonhtmlcommon::confirm_success($display);
}
+ } elsif (($display eq 'nokey') || ($display eq 'otherkey')) {
+ if ($target eq 'web') {
+ $display = $lt{$display};
+ }
}
} elsif ($item eq 'start') {
if ($starttime) {
@@ -164,7 +178,7 @@
if ($target eq 'web') {
$message .= '<td>'.$lt{'no'}.'<td>';
} else {
- $message .= $lt{'no'}.',';
+ $message .= 'no,';
}
foreach my $item (@fields) {
if ($target eq 'web') {
More information about the LON-CAPA-cvs
mailing list