--- loncom/interface/lonmsgdisplay.pm 2022/01/18 17:33:13 1.196 +++ loncom/interface/lonmsgdisplay.pm 2025/01/29 09:11:10 1.202 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.196 2022/01/18 17:33:13 raeburn Exp $ +# $Id: lonmsgdisplay.pm,v 1.202 2025/01/29 09:11:10 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -111,6 +111,7 @@ use Apache::loncommunicate; use Apache::lonfeedback; use Apache::lonrss(); use Apache::lonselstudent(); +use Apache::lonenc(); use lib '/home/httpd/lib/perl/'; use LONCAPA qw(:DEFAULT :match); @@ -228,41 +229,39 @@ function folder_choice(targetform,caller
'.&mt('Folder Actions').' - - - - - - - - -
'.$html_lt{'fold'}.'
'."\n". - &Apache::loncommon::select_form($folder,'folder',\%formhash).' -
'.$html_lt{'show'}.'
'."\n". +
+
+
+
'.$html_lt{'status'}.'
'."\n". - &Apache::loncommon::select_form($msgstatus,'msgstatus',\%statushash).' -
- '.$html_lt{'actn'}.'
'."\n".' + \%show).' + +
+
+
+ '. ' -
- '.&mt('New Folder').'
'."\n".' + +
+
+
- + -
+
'."\n". ''. - ''. - ($folder=~/^critical/?'
':''); + ''; return $output; } @@ -1134,6 +1133,7 @@ ENDDISHEADER $r->print(&blocked_in_folder($numblocked,$startblock,$endblock,$by_ip,$clientip,$blockdom, \%setters)); } + $r->print(''); return; } my $interdis = $env{'form.interdis'}; @@ -1151,7 +1151,7 @@ ENDDISHEADER $r->print('
'. &Apache::loncommon::start_data_table(). &Apache::loncommon::start_data_table_row(). - ' '); + '#'); if ($env{'form.sortedby'} eq "revdate") { $r->print(''.&mt('Date').''); } else { @@ -1230,10 +1230,10 @@ ENDDISHEADER } } my $localsenttime = &Apache::lonlocal::locallocaltime($sendtime); - $r->print(''.(($status eq 'new')?'':''). + $r->print(''); + ' value="'.$origID.'" />'); foreach my $item ($localsenttime,$dis_name,$dis_domain,$shortsubj) { $r->print(''.(($status eq 'new')?'':''). ''. @@ -1271,16 +1271,15 @@ ENDDISHEADER $r->print('
'.&mt('Message Actions').' - - - '."\n". - ''."\n"); + $r->print("\n".''."\n"); if (keys(%gotfolders) > 0) { $r->print(''); } - $r->print(''."\n". - '
'.&mt('Select Messages').'
+
+ '.&mt('Select Messages').'
'."\n". ' '."\n". ' -
'.&mt('Action').'
'."\n". + '."\n". + '
'.&mt('Destination folder').'
'); @@ -1311,10 +1310,9 @@ ENDDISHEADER $r->print(&Apache::loncommon::select_form('','movetofolder',\%userfolders). '
'. - '
'."\n". + $r->print('
'. + '
'."\n". '
'."\n" ); my $postedstartdis=$startdis+1; @@ -2503,12 +2501,16 @@ sub displaymessage { $showsymb,$env{'user.domain'},$env{'user.name'}); if ($symb) { if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) { - $showsymb = &Apache::lonenc::check_encrypt($symb); + unless ($showsymb =~ m{^/enc/}) { + $showsymb = &Apache::lonenc::encrypted($showsymb); + } } $symblink = '?symb='.$showsymb; } if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) { - $showurl = $baseurl; + unless ($showurl =~ m{^/enc/}) { + $showurl = &Apache::lonenc::encrypted($showurl); + } } $r->print(&Apache::lonhtmlcommon::row_title(&mt('Refers to')) .'
'.$restitle.'' @@ -2702,9 +2704,10 @@ sub displayresource { && (&Apache::lonnet::allowed('vgr',$content{'courseid'}))) { my $symb; if (defined($content{'symb'})) { - $symb = $content{'symb'}; - } else { - $symb=&Apache::lonnet::symbread($content{'baseurl'}); + $symb = &Apache::lonenc::check_decrypt($content{'symb'}); + } elsif (defined($content{'baseurl'})) { + $symb = + &Apache::lonnet::symbread(&Apache::lonenc::check_decrypt($content{'baseurl'})); } # Could not get a symb, give up unless ($symb) { return $content{'citation'}; } @@ -3264,9 +3267,24 @@ sub handler { 'sendreply','compose','sendmail','critical','recname','recdom', 'recordftf','sortedby','folder','startdis','interdis', 'showcommentbaseurl','dismode','group','subject','text','ref', - 'msgstatus']); + 'msgstatus','btoken']); $sqs='&sortedby='.$env{'form.sortedby'}; +# ----------- Check if access was from balancer to server with existing session + + if ($env{'form.btoken'}) { + my %info = &Apache::lonnet::tmpget($env{'form.btoken'}); + &Apache::lonnet::tmpdel($env{'form.btoken'}); + delete($env{'form.btoken'}); + unless ($env{'form.display'}) { + if (($info{'display'}) && ($info{'mailrecip'})) { + if (&unescape($info{'mailrecip'}) eq $env{'user.name'}.':'.$env{'user.domain'}) { + $env{'form.display'} = &unescape($info{'display'}); + } + } + } + } + # ------------------------------------------------------ They checked for email &Apache::lonnet::put('email_status',{'recnewemail'=>0}); @@ -3521,7 +3539,7 @@ sub handler { my $count = keys(%forwardfail); my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Could not forward [quant,_1,message].',$count),1); foreach my $key (keys(%forwardfail)) { - $message .= '
'.&mt('Could not deliver forwarded message.').' '; + $message .= '
'.&mt('Could not deliver forwarded message.').' '; if ($forwardfail{$key} eq 'blocked') { $message .= &mt('Sending messages is blocked from your IP address'); } else {