[LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm
raeburn
raeburn at source.lon-capa.org
Tue Sep 20 21:38:51 EDT 2016
raeburn Wed Sep 21 01:38:51 2016 EDT
Modified files:
/loncom/interface domainprefs.pm
Log:
- Display of status of LON-CAPA SSL certificates in Domain Configuration
for "LON-CAPA Network (SSL)" item restricted to an institution's own
LON-CAPA nodes.
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.280 loncom/interface/domainprefs.pm:1.281
--- loncom/interface/domainprefs.pm:1.280 Fri Sep 16 23:42:58 2016
+++ loncom/interface/domainprefs.pm Wed Sep 21 01:38:50 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.280 2016/09/16 23:42:58 raeburn Exp $
+# $Id: domainprefs.pm,v 1.281 2016/09/21 01:38:50 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -4083,14 +4083,28 @@
sub print_ssl {
my ($position,$dom,$settings,$rowtotal) = @_;
my ($css_class,$datatable);
- my $lonhost = '';
my $itemcount = 1;
if ($position eq 'top') {
- my %domservers = &Apache::lonnet::get_servers($dom);
+ my $primary_id = &Apache::lonnet::domain($dom,'primary');
+ my $intdom = &Apache::lonnet::internet_dom($primary_id);
+ my $same_institution;
+ if ($intdom ne '') {
+ my $internet_names = &Apache::lonnet::get_internet_names($Apache::lonnet::perlvar{'lonHostID'});
+ if (ref($internet_names) eq 'ARRAY') {
+ if (grep(/^\Q$intdom\E$/,@{$internet_names})) {
+ $same_institution = 1;
+ }
+ }
+ }
$css_class = $itemcount%2?' class="LC_odd_row"':'';
- $datatable = '<tr'.$css_class.'><td colspan="2">'.
- &LONCAPA::SSL::print_certstatus(\%domservers,'web','domprefs').
- '</td></tr>';
+ $datatable = '<tr'.$css_class.'><td colspan="2">';
+ if ($same_institution) {
+ my %domservers = &Apache::lonnet::get_servers($dom);
+ $datatable .= &LONCAPA::SSL::print_certstatus(\%domservers,'web','domprefs');
+ } else {
+ $datatable .= &mt("You need to be logged into one of your own domain's servers to display information about the status of LON-CAPA SSL certificates.");
+ }
+ $datatable .= '</td></tr>';
$itemcount ++;
} else {
my %titles = &ssl_titles();
More information about the LON-CAPA-cvs
mailing list