--- loncom/interface/lonmenu.pm 2020/10/06 21:28:33 1.503 +++ loncom/interface/lonmenu.pm 2021/01/02 21:07:36 1.504 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.503 2020/10/06 21:28:33 raeburn Exp $ +# $Id: lonmenu.pm,v 1.504 2021/01/02 21:07:36 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1283,11 +1283,12 @@ sub prepare_functions { # Determine whether or not to display 'Edit' or 'View Source' icon/button # if ($resurl =~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) { + my $blocked = &Apache::loncommon::blocking_status('about',$2,$1); my $file=&Apache::lonnet::declutter($env{'request.filename'}); ($cfile,$home,$switchserver,$forceedit,$forceview) = &Apache::lonnet::can_edit_resource($file,$cnum,$cdom, &Apache::lonnet::clutter($resurl),$env{'request.symb'},$group); - if (($cfile) && ($home ne '') && ($home ne 'no_host')) { + if (($cfile) && ($home ne '') && ($home ne 'no_host') && (!$blocked)) { $editbutton = &get_editbutton($cfile,$home,$switchserver, $forceedit,$forceview,$forcereg); } @@ -1400,10 +1401,13 @@ sub prepare_functions { if ($resurl =~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) { my ($sdom,$sname) = ($1,$2); unless (&Apache::lonnet::is_course($sdom,$sname)) { - &switch('','',6,4,'mail-message-new-22x22.png','Message to user', - '', - "go('/adm/email?compose=individual&recname=$sname&recdom=$sdom')", - 'Send message to specific user'); + my $blocked = &Apache::loncommon::blocking_status('about',$sname,$sdom); + unless ($blocked) { + &switch('','',6,4,'mail-message-new-22x22.png','Message to user', + '', + "go('/adm/email?compose=individual&recname=$sname&recdom=$sdom')", + 'Send message to specific user'); + } } my $hideprivileged = 1; if (&Apache::lonnet::in_course($sdom,$sname,$cdom,$cnum,undef,