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

www lon-capa-cvs@mail.lon-capa.org
Wed, 18 Jun 2003 15:05:32 -0000


www		Wed Jun 18 11:05:32 2003 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
  Log:
  Finishing up Bug #1782 - students could not re-init course. Now actually says
  retry.
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.60 loncom/auth/lonroles.pm:1.61
--- loncom/auth/lonroles.pm:1.60	Wed Jun 18 09:13:10 2003
+++ loncom/auth/lonroles.pm	Wed Jun 18 11:05:32 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.60 2003/06/18 13:13:10 www Exp $
+# $Id: lonroles.pm,v 1.61 2003/06/18 15:05:32 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -152,7 +152,7 @@
 			    unless ($ENV{'request.course.id'}) {
 				&Apache::lonnet::appenv(
 				      "request.course.id"  => $cdom.'_'.$cnum);
-				$furl='/adm/roles';
+				$furl='/adm/roles?tryagain=1';
 				$msg=
 	 '<h1><font color=red>Could not initialize course at this time.</font></h1><h3>Please try again.</h3>';
 			    }
@@ -228,15 +228,11 @@
    "$msg for $ENV{'user.name'} domain $ENV{'user.domain'} access $priv",$fn);
     }
 
-# ---------------------------------------------------------------- Who is this?
+# ------------------------------------------------- Can this user re-init, etc?
 
-    my $advanced=0;
-    foreach $envkey (keys %ENV) {
-        if ($envkey=~/^user\.role\./) {
-	    my (undef,undef,$role,@pwhere)=split(/\./,$envkey);
-            if ($role ne 'st') { $advanced=1; }
-        }
-    }
+    my $advanced=$ENV{'user.adv'};
+    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['tryagain']);
+    my $tryagain=$ENV{'form.tryagain'};
 
 # -------------------------------------------------------- Generate Page Output
 # --------------------------------------------------------------- Error Header?
@@ -443,7 +439,11 @@
                     } elsif ($tstatus eq 'is') {
                         $r->print('<td><input type=submit value=Select name="'.
                                   $trolecode.'"></td>');
-                    } elsif ($ENV{'user.adv'}) {
+                    } elsif ($tryagain) {
+                        $r->print
+                        ('<td><input type=submit value="Try Selecting Again"'.
+                             ' name="'.$trolecode.'"></td>');
+                    } elsif ($advanced) {
                         $r->print
                             ('<td><input type=submit value="Re-Initialize"'.
                              ' name="'.$trolecode.'"></td>');