--- loncom/auth/lonroles.pm 2021/10/26 14:25:09 1.352 +++ loncom/auth/lonroles.pm 2021/11/19 19:19:35 1.356 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.352 2021/10/26 14:25:09 raeburn Exp $ +# $Id: lonroles.pm,v 1.356 2021/11/19 19:19:35 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -158,12 +158,21 @@ sub start_loading_course { my $brcrum = [{'href' => '', 'text' => $title},]; my $start_page = &Apache::loncommon::start_page($title,undef, - {'bread_crumbs' => $brcrum,}); + {'bread_crumbs' => $brcrum, + 'bread_crumbs_nomenu' => 1, + 'links_disabled' => 1}); $r->print(< // ENDREDIR @@ -172,8 +181,7 @@ ENDREDIR sub finish_loading_course { my ($r,$msg,$url) = @_; -#FIXME add continue link, and add jquery to enable menu links when page is loaded - my $link; + my $link = ''; my $end_page = &Apache::loncommon::end_page(); my $js_url = &js_escape($url); $r->print(< // a').removeAttr("aria-disabled"); + \$('.isDisabled').removeClass("isDisabled"); var url = "$js_url"; \$(location).attr('href',url); }); @@ -912,6 +923,9 @@ ENDCLOSE $dest .= (($dest =~/\?/)? '&':'?').'symb='.$esc_symb; } } + if ($env{'form.ttoken'}) { + $dest .= (($dest =~/\?/)? '&':'?').'ttoken='.$env{'form.ttoken'}; + } unless ($env{'request.lti.login'}) { $msg = '

'.&mt('Entering [_1] ...', $env{'course.'.$cdom.'_'.$cnum.'.description'}). @@ -1054,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; @@ -1090,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); + 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}); @@ -1202,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) {