--- loncom/auth/lonroles.pm 2009/11/03 03:01:47 1.240 +++ loncom/auth/lonroles.pm 2009/12/07 04:38:22 1.240.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.240 2009/11/03 03:01:47 raeburn Exp $ +# $Id: lonroles.pm,v 1.240.2.2 2009/12/07 04:38:22 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -318,6 +318,9 @@ sub handler { } } } + if (($env{'form.cm'}) && ($env{'form.orgurl'})) { + $r->internal_redirect($env{'form.orgurl'}); + } foreach $envkey (keys %env) { next if ($envkey!~/^user\.role\./); @@ -767,6 +770,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('

'.&mt('Please stand by.').'

'. + ''. + ''); + $r->print("\n"); + $r->rflush(); + $r->print(''); + $r->print(&Apache::loncommon::end_page()); + return OK; + } + if ($needs_switchserver) { + $r->print("

".&mt('Server Switch Required')."

\n". + &mt('Construction Space access is only available from '. + 'the home server of the corresponding Author.').'
'. + &mt("Click the 'Switch Server' link to go there.").'
'); + } } # ----------------------------------------------------------------------- Table unless ((!&Apache::loncommon::show_course()) || ($nochoose) || ($countactive==1)) {