[LON-CAPA-cvs] cvs: loncom /interface coursecatalog.pm
raeburn
raeburn at source.lon-capa.org
Fri Apr 30 14:19:41 EDT 2021
raeburn Fri Apr 30 18:19:41 2021 EDT
Modified files:
/loncom/interface coursecatalog.pm
Log:
- Bug 6914
Make $hostname available for passing to &Apache::lonnet::waf_allssl() to
check whether access was via WAF alias, and WAF forwards both http + https
requests to https (if so, skip usehttp=1 for 'http' externalsyllabus).
Index: loncom/interface/coursecatalog.pm
diff -u loncom/interface/coursecatalog.pm:1.103 loncom/interface/coursecatalog.pm:1.104
--- loncom/interface/coursecatalog.pm:1.103 Thu Apr 29 17:45:22 2021
+++ loncom/interface/coursecatalog.pm Fri Apr 30 18:19:41 2021
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler for displaying the course catalog interface
#
-# $Id: coursecatalog.pm,v 1.103 2021/04/29 17:45:22 raeburn Exp $
+# $Id: coursecatalog.pm,v 1.104 2021/04/30 18:19:41 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -337,7 +337,7 @@
$catlinks,$catjs,\@codetitles,$cattype,$canviewall);
if ($env{'form.state'} eq 'listing') {
$r->print(&print_course_listing($codedom,$numtitles,undef,undef,undef,
- \@codetitles,$canviewall));
+ \@codetitles,$canviewall,$hostname));
}
} else {
my (%add_entries);
@@ -386,7 +386,7 @@
}
if ($env{'form.state'} eq 'listing') {
$r->print(&print_course_listing($codedom,undef,\@trails,\%allitems,$subcats,\@codetitles,
- $canviewall));
+ $canviewall,$hostname));
}
}
}
@@ -699,7 +699,7 @@
$r->print(
&Apache::lonhtmlcommon::breadcrumbs('Course/Community Catalog').
'<h2>'.$textthree.'</h2>'.
- &print_course_listing($codedom,undef,$trails,$allitems,undef,$codetitles).
+ &print_course_listing($codedom,undef,$trails,$allitems,undef,$codetitles,undef,$hostname).
'<br />'.
'<form name="'.$formname.'" method="post" action="/adm/coursecatalog">'.
&Apache::lonhtmlcommon::actionbox([
@@ -1322,7 +1322,7 @@
}
sub print_course_listing {
- my ($domain,$numtitles,$trails,$allitems,$subcats,$codetitles,$canviewall) = @_;
+ my ($domain,$numtitles,$trails,$allitems,$subcats,$codetitles,$canviewall,$hostname) = @_;
my $output;
my %courses;
my $knownuser = &user_is_known();
@@ -1375,7 +1375,7 @@
}
my $now = time;
$output .= &construct_data_table($knownuser,$domain,\%courses,$details,undef,
- $now,$trails,$allitems,$canviewall);
+ $now,$trails,$allitems,$canviewall,$hostname);
$output .= "\n".'<form name="linklaunch" method="post" action="">'.
'<input type="hidden" name="backto" value="coursecatalog" />'.
'<input type="hidden" name="courseid" value="" />'.
@@ -1384,7 +1384,8 @@
}
sub construct_data_table {
- my ($knownuser,$domain,$courses,$details,$usersections,$now,$trails,$allitems,$canviewall) = @_;
+ my ($knownuser,$domain,$courses,$details,$usersections,$now,
+ $trails,$allitems,$canviewall,$hostname) = @_;
my %sortname;
if (($details eq '') || ($env{'form.showdetails'})) {
$sortname{'Code'} = 'code';
@@ -1886,7 +1887,7 @@
my $usehttp = 0;
if (($ENV{'SERVER_PORT'} == 443) && ($extsyllplain)) {
unless ((&Apache::lonnet::uses_sts()) ||
- (&Apache::lonnet::waf_allssl(hostname))) {
+ (&Apache::lonnet::waf_allssl($hostname))) {
$usehttp = 1;
}
}
More information about the LON-CAPA-cvs
mailing list