--- loncom/auth/lonroles.pm 2009/08/12 20:25:35 1.231.4.1 +++ loncom/auth/lonroles.pm 2009/09/23 16:45:17 1.231.6.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.231.4.1 2009/08/12 20:25:35 raeburn Exp $ +# $Id: lonroles.pm,v 1.231.6.2 2009/09/23 16:45:17 gci Exp $ # # Copyright Michigan State University Board of Trustees # @@ -159,7 +159,7 @@ sub redirect_user { } my $start_page = &Apache::loncommon::start_page('Switching Role',undef, - {'redirect' => [1,$url].}); + {'redirect' => [1,$url]}); my $end_page = &Apache::loncommon::end_page(); # Note to style police: @@ -740,6 +740,27 @@ ENDHEADER } $r->print(&Apache::loncommon::end_page()); return OK; + } elsif ($countactive==1) { # Is there only one choice? + my $needs_switchserver; + if ($env{'user.author'}) { + $needs_switchserver = &check_needs_switchserver($possiblerole); + } + if ((!$needs_switchserver) && ($env{'request.role'} eq 'cm')) { + $r->print('