--- loncom/interface/loncommon.pm 2007/08/30 20:26:50 1.564.2.3 +++ loncom/interface/loncommon.pm 2007/08/30 23:02:03 1.564.2.4 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.564.2.3 2007/08/30 20:26:50 albertel Exp $ +# $Id: loncommon.pm,v 1.564.2.4 2007/08/30 23:02:03 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3458,9 +3458,6 @@ sub bodytag { if (!$realm) { $realm=' '; } # Set messages my $messages=&domainlogo($domain); -# Port for miniserver - my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'}; - if (!defined($lonhttpdPort)) { $lonhttpdPort='8080'; } my $extra_body_attr = &make_attr_string($forcereg,\%design); @@ -3578,7 +3575,7 @@ ENDROLE my $imgsrc = $img; if ($img =~ /^\/adm/) { - $imgsrc = 'http://'.$ENV{'HTTP_HOST'}.':'.$lonhttpdPort.$img; + $imgsrc = &lonhttpdurl($img); } my $upperleft=''.$function.''; @@ -7305,16 +7302,25 @@ sub icon { return &lonhttpdurl($iconname); } -sub lonhttpdurl { - my ($url)=@_; +sub lonhttpd_port { my $lonhttpd_port=$Apache::lonnet::perlvar{'lonhttpdPort'}; if (!defined($lonhttpd_port)) { $lonhttpd_port='8080'; } - # IE doesn't like a secure page getting images from a non-secure # port (when logging we haven't parsed the browser type so default # back to secure if ((!exists($env{'browser.type'}) || $env{'browser.type'} eq 'explorer') && $ENV{'SERVER_PORT'} == 443) { + return 443; + } + return $lonhttpd_port; + +} + +sub lonhttpdurl { + my ($url)=@_; + + my $lonhttpd_port = &lonhttpd_port(); + if ($lonhttpd_port == 443) { return 'https://'.$ENV{'SERVER_NAME'}.$url; } return 'http://'.$ENV{'SERVER_NAME'}.':'.$lonhttpd_port.$url;