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

www lon-capa-cvs@mail.lon-capa.org
Mon, 07 Apr 2003 18:24:05 -0000


www		Mon Apr  7 14:24:05 2003 EDT

  Modified files:              
    /loncom/auth	lonauth.pm lonroles.pm 
  Log:
  New environment variable $ENV{'request.role.adv'} to check if the *current*
  role is advanced.
  
  
Index: loncom/auth/lonauth.pm
diff -u loncom/auth/lonauth.pm:1.47 loncom/auth/lonauth.pm:1.48
--- loncom/auth/lonauth.pm:1.47	Thu Apr  3 11:50:46 2003
+++ loncom/auth/lonauth.pm	Mon Apr  7 14:24:05 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # User Authentication Module
 #
-# $Id: lonauth.pm,v 1.47 2003/04/03 16:50:46 www Exp $
+# $Id: lonauth.pm,v 1.48 2003/04/07 18:24:05 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -130,6 +130,7 @@
 	print $idf "request.course.uri=\n";
 	print $idf "request.course.sec=\n";
 	print $idf "request.role=cm\n";
+        print $idf "request.role.adv=$ENV{'user.adv'}\n";
 	print $idf "request.host=$ENV{'REMOTE_ADDR'}\n";
 	if ($FORM{'interface'}) {
 	    $FORM{'interface'}=~s/\W//gs;
@@ -147,6 +148,7 @@
 	$idf->close();
     }
     $ENV{'request.role'}='cm';
+    $ENV{'request.role.adv'}=$ENV{'user.adv'};
     $ENV{'browser.type'}=$clientbrowser;
 # -------------------------------------------------------------------- Log this
 
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.55 loncom/auth/lonroles.pm:1.56
--- loncom/auth/lonroles.pm:1.55	Mon Mar 24 13:46:44 2003
+++ loncom/auth/lonroles.pm	Mon Apr  7 14:24:05 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.55 2003/03/24 18:46:44 albertel Exp $
+# $Id: lonroles.pm,v 1.56 2003/04/07 18:24:05 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -72,6 +72,7 @@
 				"request.course.uri"  => '',
 				"request.course.sec"  => '',
 				"request.role"        => 'cm',
+                                "request.role.adv"    => $ENV{'user.adv'},
 				"request.role.domain" => $ENV{'user.domain'});
         foreach $envkey (keys %ENV) {
             next if ($envkey!~/^user\.role\./);
@@ -129,9 +130,15 @@
 			     }
 			 }
 		     }
-		    &Apache::lonnet::appenv('request.role'        => $trolecode,
-					    'request.role.domain' => $cdom,
-					    'request.course.sec'  => $csec);
+                    my $tadv=0;
+                    if (($trolecode!~/^st/) && 
+                        ($trolecode!~/^ta/) && 
+                        ($trolecode!~/^cm/)) { $tadv=1; }
+		    &Apache::lonnet::appenv(
+                                           'request.role'        => $trolecode,
+					   'request.role.adv'    => $tadv,
+					   'request.role.domain' => $cdom,
+					   'request.course.sec'  => $csec);
 		    my $msg='Entering course ...';
 		    if (($cnum) && ($role ne 'ca')) {
 			my ($furl,$ferr)=