--- loncom/interface/lonmsgdisplay.pm 2006/12/24 22:13:19 1.59
+++ 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.59 2006/12/24 22:13:19 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.62 2007/01/04 16:54:07 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1072,7 +1072,7 @@ ENDDISHEADER
' value="'.$origID.'" />');
foreach my $item ($localsenttime,$dis_name,$dis_domain,$shortsubj) {
$r->print('
'.(($status eq 'new')?'':'').
- ''.
+ ''.
$item.(($status eq 'new')?'':'').' | ');
}
my $showstatus;
@@ -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.'');
+ }
}
}
}
@@ -2289,11 +2301,9 @@ sub sendoffmail {
my $msgtxt = $savemsg;
if ($toaddr{$address}) { $msgtxt.='
'.$toaddr{$address}; }
my @thismsg;
- if ((($env{'form.critmsg'}) || ($env{'form.sendbck'})) &&
- (&Apache::lonnet::allowed('srm',$env{'request.course.id'})
- || &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
- '/'.$env{'request.course.sec'}))) {
- $r->print(&mt('Sending critical message').' '.$recuname.':'.$recdomain.': ');
+ if ($msgtype eq 'critical') {
+ $r->print(&mt('Sending critical message').' '.
+ $recuname.':'.$recdomain.': ');
@thismsg=
&Apache::lonmsg::user_crit_msg($recuname,$recdomain,
$msgsubj,$msgtxt,
@@ -2315,7 +2325,7 @@ sub sendoffmail {
$specialmsg_status{$recuname.':'.$recdomain} =
join(' ',@thismsg);
foreach my $result (@thismsg) {
- if ($result eq 'ok') {
+ if ($result eq 'ok' || $result eq 'con_delayed') {
$numspecial++;
}
}