--- loncom/interface/lonmenu.pm 2012/12/27 05:52:00 1.369.2.30 +++ loncom/interface/lonmenu.pm 2012/12/28 17:26:15 1.369.2.31 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.369.2.30 2012/12/27 05:52:00 raeburn Exp $ +# $Id: lonmenu.pm,v 1.369.2.31 2012/12/28 17:26:15 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -346,6 +346,15 @@ sub secondary_menu { my $canmgr = &Apache::lonnet::allowed('mgr', $crs_sec); my $author = &getauthor(); + my ($canmodifycoauthor); + if ($env{'request.role'} eq "au./$env{'user.domain'}/") { + my $extent = "$env{'user.domain'}/$env{'user.name'}"; + if ((&Apache::lonnet::allowed('cca',$extent)) || + (&Apache::lonnet::allowed('caa',$extent))) { + $canmodifycoauthor = 1; + } + } + my %groups = &Apache::lonnet::get_active_groups( $env{'user.domain'}, $env{'user.name'}, $env{'course.' . $env{'request.course.id'} . '.domain'}, @@ -357,7 +366,7 @@ sub secondary_menu { # evaluate conditions next if ref($menuitem) ne 'ARRAY'; next if $$menuitem[4] ne 'always' - && $$menuitem[4] ne 'author' + && ($$menuitem[4] ne 'author' && $$menuitem[4] ne 'cca') && !$env{'request.course.id'}; next if $$menuitem[4] =~ /^mdc/ && !$canedit; @@ -385,6 +394,8 @@ sub secondary_menu { && ($canviewgrps || !%groups); next if $$menuitem[4] eq 'author' && !$author; + next if $$menuitem[4] eq 'cca' + && !$canmodifycoauthor; my $title = $menuitem->[3]; if (defined($secondary_submenu{$title})) { @@ -1291,7 +1302,8 @@ sub prepare_functions { $forceedit,$forceview,$forcereg, $env{'form.title'},$env{'form.suppurl'}); } - } elsif ($resurl !~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) { + } elsif (($resurl !~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) && + ($resurl ne '/cgi-bin/printout.pl')) { if ($env{'request.filename'}) { my $file=&Apache::lonnet::declutter($env{'request.filename'}); ($cfile,$home,$switchserver,$forceedit,$forceview) =