--- loncom/auth/lonroles.pm 2021/11/15 22:36:38 1.354 +++ loncom/auth/lonroles.pm 2021/11/16 05:20:02 1.355 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.354 2021/11/15 22:36:38 raeburn Exp $ +# $Id: lonroles.pm,v 1.355 2021/11/16 05:20:02 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1068,6 +1068,10 @@ ENDCLOSE $recent = &mt('Recent Courses'); $standby = &mt('Course selected. Please stand by.'); } + if (($norolelist) && ((split(/:/,$env{'user.error.msg'}))[2])) { + $crumbtext = 'Access Denied'; + $pagetitle = 'Unauthorized'; + } my $brcrum =[{href=>"/adm/roles",text=>$crumbtext}]; my %roles_in_env; @@ -1104,11 +1108,13 @@ ENDCLOSE $start_page=&Apache::loncommon::start_page($pagetitle,undef, {bread_crumbs=>$brcrum,crstype=>'Placement'}); } else { - $funcs = &get_roles_functions($showcount,$cattype); - my $crumbsright; - if ($env{'browser.mobile'}) { - $crumbsright = $funcs; - undef($funcs); + my $crumbsright); + unless (($norolelist) && ((split(/:/,$env{'user.error.msg'}))[2])) { + $funcs = &get_roles_functions($showcount,$cattype); + if ($env{'browser.mobile'}) { + $crumbsright = $funcs; + undef($funcs); + } } $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum, bread_crumbs_component=>$crumbsright}); @@ -1216,8 +1222,16 @@ ENDHEADER } if ($nochoose) { $r->print("

".&mt('Sorry ...')."

\n". - &mt('This action is currently not authorized.').''. - &Apache::loncommon::end_page()); + &mt('This action is currently not authorized.').''); + if ($error && $norolelist) { + $r->print('

'. + &mt('As your session was launched from a web page external to LON-CAPA some course content may be unavailable, including the resource you were trying to access.'). + '

'. + '

'. + &mt('You may need to login to LON-CAPA directly, or re-launch from a different external system.'). + '

'); + } + $r->print(&Apache::loncommon::end_page()); return OK; } else { if ($updateresult || $reqauthor || $hotlist) {