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

raeburn raeburn@source.lon-capa.org
Sun, 20 Dec 2009 04:11:27 -0000


raeburn		Sun Dec 20 04:11:27 2009 EDT

  Modified files:              (Branch: GCI_3)
    /loncom/auth	lonroles.pm 
  Log:
  - Customization for GCI_3. 
   - Eliminate duplicate code.
   - Set request.role.adv before calling lonuserstate::readmap() so order
      randomized when CC is viewing as a student (if randomorder set for folder). 
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.240.2.3 loncom/auth/lonroles.pm:1.240.2.4
--- loncom/auth/lonroles.pm:1.240.2.3	Tue Dec 15 05:04:17 2009
+++ loncom/auth/lonroles.pm	Sun Dec 20 04:11:27 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.240.2.3 2009/12/15 05:04:17 raeburn Exp $
+# $Id: lonroles.pm,v 1.240.2.4 2009/12/20 04:11:27 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -449,6 +449,8 @@
 
 		    if (($cnum) && ($role ne 'ca') && ($role ne 'aa')) {
                         my $msg;
+                        if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; }
+                        &Apache::lonnet::appenv({'request.role.adv'=>$tadv});
 			my ($furl,$ferr)=
 			    &Apache::lonuserstate::readmap($cdom.'/'.$cnum);
 			if (($env{'form.orgurl'}) && 
@@ -462,8 +464,6 @@
                                 }
                                 $dest .= 'symb='.$env{'form.symb'};
                             }
-			    if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; }
-			    &Apache::lonnet::appenv({'request.role.adv'=>$tadv});
                             if (($ferr) && ($tadv)) {
 				&error_page($r,$ferr,$dest);
 			    } else {
@@ -482,8 +482,6 @@
                     .'<p>'.&mt('Please try again.').'</p>'
                     .'<p>'.$ferr.'</p>';
 			    }
-			    if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; }
-			    &Apache::lonnet::appenv({'request.role.adv'=>$tadv});
 
 			    if (($ferr) && ($tadv)) {
 				&error_page($r,$ferr,$furl);