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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 03 Mar 2005 07:32:49 -0000


albertel		Thu Mar  3 02:32:49 2005 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
  Log:
  - BG#3985, the adv permissions didn;t have an effect in cases where it depended on athe course id
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.116 loncom/auth/lonroles.pm:1.117
--- loncom/auth/lonroles.pm:1.116	Thu Mar  3 02:16:44 2005
+++ loncom/auth/lonroles.pm	Thu Mar  3 02:32:49 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.116 2005/03/03 07:16:44 albertel Exp $
+# $Id: lonroles.pm,v 1.117 2005/03/03 07:32:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -224,9 +224,6 @@
 					   'request.role.domain' => $cdom,
 					   'request.course.sec'  => $csec);
                     my $tadv=0;
-		    if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; }
-		    &Apache::lonnet::appenv('request.role.adv'    => $tadv);
-
 		    my $msg=&mt('Entering course ...');
 
 		    if (($cnum) && ($role ne 'ca')) {
@@ -238,6 +235,8 @@
 			    if ( &Apache::lonnet::mod_perl_version() == 2 ) {
 				&Apache::lonnet::cleanenv();
 			    }
+			    if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; }
+			    &Apache::lonnet::appenv('request.role.adv'=>$tadv);
 			    $r->internal_redirect($dest);
 			    return OK;
 			} else {
@@ -250,6 +249,8 @@
 			 &mt('Could not initialize course at this time.').
 		    '</font></h1><h3>'.&mt('Please try again.').'</h3>'.$ferr;
 			    }
+			    if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; }
+			    &Apache::lonnet::appenv('request.role.adv'=>$tadv);
 
 			    # Check to see if the user is a CC entering a course 
 			    # for the first time