--- loncom/interface/lonmsgdisplay.pm 2007/01/04 02:02:36 1.61 +++ loncom/interface/lonmsgdisplay.pm 2007/01/04 20:58:26 1.63 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.61 2007/01/04 02:02:36 raeburn Exp $ +# $Id: lonmsgdisplay.pm,v 1.63 2007/01/04 20:58:26 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2045,25 +2045,36 @@ sub displaymessage { if (defined($content{'courseid'}) && defined($env{'request.course.id'})) { if ($content{'courseid'} eq $env{'request.course.id'}) { my $symblink; + my $showsymb = &Apache::lonenc::check_decrypt($symb); + my $showurl = &Apache::lonenc::check_decrypt($baseurl); + my $encrypturl = &Apache::lonnet::EXT('resource.0.encrypturl', + $showsymb,$env{'user.domain'},$env{'user.name'}); if ($symb) { - &Apache::lonenc::check_decrypt(\$symb); - $symblink = '?symb='.$symb; + if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) { + $showsymb = &Apache::lonenc::check_encrypt($symb); + } + $symblink = '?symb='.$showsymb; + } + if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) { + $showurl = $baseurl; } - &Apache::lonenc::check_decrypt(\$baseurl); - $r->print('
'.&mt('Refers to').': '.$restitle.''); + $r->print('
'.&mt('Refers to').': '.$restitle.''); $refers_to = 1; } } if (!$refers_to) { if ($baseurl =~ m-^/enc/-) { if (defined($content{'courseid'})) { - my $unencurl = - &Apache::lonenc::unencrypted($baseurl, - $content{'courseid'}); - if (defined($unencurl)) { - if (&Apache::lonnet::allowed('bre',$unencurl)) { - $r->print('
'.&mt('Refers to'). - ': '.$restitle.''); + if (!$env{'request.course.id'}) { + my $unencurl = + &Apache::lonenc::unencrypted($baseurl, + $content{'courseid'}); + if ($unencurl ne '') { + if (&Apache::lonnet::allowed('bre',$unencurl)) { + $r->print('
'.&mt('Refers to'). + ': '. + $restitle.''); + } } } }