--- loncom/interface/lonmsgdisplay.pm 2007/01/04 02:02:36 1.61
+++ loncom/interface/lonmsgdisplay.pm 2007/01/04 16:54:07 1.62
@@ -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.62 2007/01/04 16:54:07 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2030,6 +2030,7 @@ sub displaymessage {
if (defined($content{'baseurl'})) {
$baseurl = &Apache::lonenc::check_encrypt($content{'baseurl'});
}
+ print STDERR "baseurl is $content{'baseurl'}, title is $content{'resource_title'}, symb is $content{'symb'}, course is $content{'courseid'}\n";
$r->print('
'.&mt('Subject').': '.$content{'subject'}.
($folder ne 'sent'?'
'.&mt('From').': '.
&Apache::loncommon::aboutmewrapper(
@@ -2045,25 +2046,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.'');
+ }
}
}
}