--- loncom/interface/lonmsg.pm 2008/12/13 23:37:56 1.214.2.1 +++ loncom/interface/lonmsg.pm 2008/12/21 04:21:53 1.214.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging # -# $Id: lonmsg.pm,v 1.214.2.1 2008/12/13 23:37:56 raeburn Exp $ +# $Id: lonmsg.pm,v 1.214.2.2 2008/12/21 04:21:53 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -83,10 +83,10 @@ sub packagemsg { $citation=&HTML::Entities::encode($citation,'<>&"'); $subject =&HTML::Entities::encode($subject,'<>&"'); #remove machine specification - $baseurl =~ s|^http://[^/]+/|/|; + $baseurl =~ s|^https?\://[^/]+/|/|; $baseurl =&HTML::Entities::encode($baseurl,'<>&"'); #remove machine specification - $attachmenturl =~ s|^http://[^/]+/|/|; + $attachmenturl =~ s|^https\://[^/]+/|/|; $attachmenturl =&HTML::Entities::encode($attachmenturl,'<>&"'); my $course_context = &get_course_context(); my $now=time; @@ -316,9 +316,11 @@ sub sendnotification { $text=~s/\<\;/\/gs; - my $url='http://'. - &Apache::lonnet::hostname(&Apache::lonnet::homeserver($touname,$toudom)). - '/adm/email?username='.$touname.'&domain='.$toudom; + my $homeserver = &Apache::lonnet::homeserver($touname,$toudom); + my $protocol = $Apache::lonnet::protocol{$homeserver}; + $protocol = 'http' if ($protocol ne 'https'); + my $url = $protocol.'://'.&Apache::lonnet::hostname($homeserver). + '/adm/email?username='.$touname.'&domain='.$toudom; my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid, $symb,$error) = &Apache::lonmsg::unpackmsgid($msgid); my ($coursetext,$body,$bodybegin,$bodysubj,$bodyend);