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

raeburn raeburn@source.lon-capa.org
Sun, 06 Dec 2009 19:47:47 -0000


raeburn		Sun Dec  6 19:47:47 2009 EDT

  Modified files:              (Branch: GCI_3)
    /loncom/auth	lonroles.pm 
  Log:
  - Customization for GCI_3.
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.240 loncom/auth/lonroles.pm:1.240.2.1
--- loncom/auth/lonroles.pm:1.240	Tue Nov  3 03:01:47 2009
+++ loncom/auth/lonroles.pm	Sun Dec  6 19:47:47 2009
@@ -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.1 2009/12/06 19:47:47 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -767,6 +767,27 @@
         }
         $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('<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
     unless ((!&Apache::loncommon::show_course()) || ($nochoose) || ($countactive==1)) {