--- loncom/interface/loncommon.pm 2006/08/17 22:35:52 1.445 +++ loncom/interface/loncommon.pm 2006/08/22 17:15:19 1.447 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.445 2006/08/17 22:35:52 albertel Exp $ +# $Id: loncommon.pm,v 1.447 2006/08/22 17:15:19 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2109,6 +2109,9 @@ sub noteswrapper { sub aboutmewrapper { my ($link,$username,$domain,$target)=@_; + if (!defined($username) && !defined($domain)) { + return; + } return ''.$link.''; } @@ -5921,6 +5924,15 @@ sub lonhttpdurl { return 'http://'.$ENV{'SERVER_NAME'}.':'.$lonhttpd_port.$url; } +sub absolute_url { + my ($host_name) = @_; + my $protocol = ($ENV{'SERVER_PORT'} == 443?'https://':'http://'); + if ($host_name eq '') { + $host_name = $ENV{'SERVER_NAME'}; + } + return $protocol.$host_name; +} + sub connection_aborted { my ($r)=@_; $r->print(" ");$r->rflush();