--- loncom/interface/lonmsg.pm 2008/11/19 17:38:26 1.215 +++ loncom/interface/lonmsg.pm 2008/12/19 02:43:52 1.218 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging # -# $Id: lonmsg.pm,v 1.215 2008/11/19 17:38:26 jms Exp $ +# $Id: lonmsg.pm,v 1.218 2008/12/19 02:43:52 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -224,10 +224,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; @@ -430,8 +430,8 @@ sub sendemail { } } $body= - "*** ".&mt_user($user_lh,'This is an automatic message generated by the LON-CAPA system.')."\n". - "*** ".($senderaddress?&mt_user($user_lh,'You can reply to this message'):&mt_user($user_lh,'Please do not reply to this address.')."\n*** ". + "*** ".&mt_user($user_lh,'This is an automatic e-mail generated by the LON-CAPA system.')."\n". + "*** ".($senderaddress?&mt_user($user_lh,'You can reply to this e-mail'):&mt_user($user_lh,'Please do not reply to this address.')."\n*** ". &mt_user($user_lh,'A reply will not be received by the recipient!'))."\n\n".$body; my $msg = new Mail::Send; $msg->to($to); @@ -455,9 +455,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); @@ -1013,7 +1015,7 @@ sub user_lang { } } } - my @languages=&Apache::loncommon::get_genlanguages(@userlangs); + my @languages=&Apache::lonlocal::get_genlanguages(@userlangs); my $user_lh = Apache::localize->get_handle(@languages); return $user_lh; }