[LON-CAPA-cvs] cvs: loncom(loncapaMITrelate_1) /auth lonroles.pm

raeburn raeburn at source.lon-capa.org
Wed Feb 8 20:11:52 EST 2012


raeburn		Thu Feb  9 01:11:52 2012 EDT

  Modified files:              (Branch: loncapaMITrelate_1)
    /loncom/auth	lonroles.pm 
  Log:
  - Customization for MITrelate
    - Switch directly to active role, if only one active role, and no 
      future roles.
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.256.2.6.2.2 loncom/auth/lonroles.pm:1.256.2.6.2.3
--- loncom/auth/lonroles.pm:1.256.2.6.2.2	Wed Feb  8 16:27:35 2012
+++ loncom/auth/lonroles.pm	Thu Feb  9 01:11:52 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.256.2.6.2.2 2012/02/08 16:27:35 raeburn Exp $
+# $Id: lonroles.pm,v 1.256.2.6.2.3 2012/02/09 01:11:52 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -878,6 +878,27 @@
         }
         $r->print(&Apache::loncommon::end_page());
 	return OK;
+    } elsif ($countactive==1 && $countfuture==0) { # 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('<h3>'.&mt('Please stand by.').'</h3>'.
+                '<input type="hidden" name="'.$possiblerole.'" value="1" />'.
+            '<noscript><br /><input type="submit" name="submit" value="'.&mt('Continue').'" /></noscript>');
+            $r->print("</form>\n");
+            $r->rflush();
+            $r->print('<script type="text/javascript">document.forms.rolechoice.submit();</script>');
+            $r->print(&Apache::loncommon::end_page());
+            return OK;
+        }
+        if ($needs_switchserver) {
+            $r->print("<h2>".&mt('Server Switch Required')."</h2>\n".
+                      &mt('Construction Space access is only available from '.
+                          'the home server of the corresponding Author.').'<br />'.
+                      &mt("Click the 'Switch Server' link to go there.").'<br />');
+        }
     }
 # ----------------------------------------------------------------------- Table
 




More information about the LON-CAPA-cvs mailing list