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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Mon, 10 Sep 2007 16:07:33 -0000


raeburn		Mon Sep 10 12:07:33 2007 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
  Log:
  With SSO enabled, it is possible to log-in and reach the roles screen with Javascript disabled.
  - provide a warning
  - for users with a single active role, provide a "Continue" button.
  - xhtml
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.178 loncom/auth/lonroles.pm:1.179
--- loncom/auth/lonroles.pm:1.178	Mon Sep 10 07:44:00 2007
+++ loncom/auth/lonroles.pm	Mon Sep 10 12:07:32 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.178 2007/09/10 11:44:00 www Exp $
+# $Id: lonroles.pm,v 1.179 2007/09/10 16:07:32 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -201,7 +201,7 @@
 				 }
 				 $r->print(<<ENDENTEREDKEY);
 $start_page
-<script>
+<script type="text/javascript">
 $swinfo
 </script>
 <form method="post">
@@ -224,7 +224,7 @@
 				 my $end_page=&Apache::loncommon::end_page();
 				 $r->print(<<ENDENTERKEY);
 $start_page
-<script>
+<script type="text/javascript">
 $swinfo
 </script>
 <form method="post">
@@ -365,11 +365,15 @@
     my $start_page=&Apache::loncommon::start_page('User Roles');
     my $standby=&mt('Role selected. Please stand by.');
     $standby=~s/\n/\\n/g;
+    my $noscript='<span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will ba unavailable.').'</span><br />';
 
     $r->print(<<ENDHEADER);
 $start_page
 <br />
-<script>
+<noscript>
+$noscript
+</noscript>
+<script type="text/javascript">
 $swinfo
 window.focus();
 
@@ -628,10 +632,11 @@
 # Is there only one choice?
     } elsif (($countactive==1) && ($env{'request.role'} eq 'cm')) {
 	$r->print('<h3>'.&mt('Please stand by.').'</h3>'.
-	    '<input type="hidden" name="'.$possiblerole.'" value="1" />');
+	    '<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>document.forms.rolechoice.submit();</script>');
+	$r->print('<script type="text/javascript">document.forms.rolechoice.submit();</script>');
 	$r->print(&Apache::loncommon::end_page());
 	return OK;
     }
@@ -926,7 +931,7 @@
 
 sub coursepick_jscript {
     my $verify_script = <<"END";
-<script>
+<script type="text/javascript">
 function verifyCoursePick(caller) {
     var numbutton = getIndex(caller)
     var pickedCourse = document.rolechoice.elements[numbutton+4].value
@@ -962,7 +967,7 @@
 
 sub processpick {
     my $process_pick = <<"END";
-<script>
+<script type="text/javascript">
 function process_pick(dom) {
     var pickedCourse=opener.document.rolechoice.$env{'form.cnumelement'}.value;
     var pickedDomain=opener.document.rolechoice.$env{'form.cdomelement'}.value;