[LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm

www lon-capa-cvs@mail.lon-capa.org
Fri, 20 Jun 2003 14:37:26 -0000


www		Fri Jun 20 10:37:26 2003 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  Bug #1830: confusion about revoking expired roles
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.55 loncom/interface/loncreateuser.pm:1.56
--- loncom/interface/loncreateuser.pm:1.55	Thu Jun 19 17:46:38 2003
+++ loncom/interface/loncreateuser.pm	Fri Jun 20 10:37:26 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.55 2003/06/19 21:46:38 www Exp $
+# $Id: loncreateuser.pm,v 1.56 2003/06/20 14:37:26 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -46,7 +46,7 @@
 # 05/10,10/16 Gerd Kortemeyer 
 # 02/11/02 Matthew Hall
 #
-# $Id: loncreateuser.pm,v 1.55 2003/06/19 21:46:38 www Exp $
+# $Id: loncreateuser.pm,v 1.56 2003/06/20 14:37:26 www Exp $
 ###
 
 package Apache::loncreateuser;
@@ -345,7 +345,11 @@
                if (($active) && ($allowed)) {
                    $row.= '<input type="checkbox" name="rev:'.$thisrole.'">';
                } else {
-                   $row.='&nbsp;';
+                   if ($active) {
+                      $row.='&nbsp;';
+		   } else {
+                      $row.='expired or revoked';
+		   }
                }
 	       $row.='</td><td>';
                if ($delallowed) {
@@ -724,20 +728,20 @@
 	# Revoke roles
 	if ($_=~/^form\.rev/) {
 	    if ($_=~/^form\.rev\:([^\_]+)\_([^\_]+)$/) {
-	        $r->print('Revoking '.$2.' in '.$1.': '.
+	        $r->print('Revoking '.$2.' in '.$1.': <b>'.
                      &Apache::lonnet::assignrole($ENV{'form.ccdomain'},
-                     $ENV{'form.ccuname'},$1,$2,$now).'<br>');
+                     $ENV{'form.ccuname'},$1,$2,$now).'</b><br>');
 		if ($2 eq 'st') {
 		    $1=~/^\/(\w+)\/(\w+)/;
 		    my $cid=$1.'_'.$2;
-		    $r->print('Drop from classlist: '.
+		    $r->print('Drop from classlist: <b>'.
 			 &Apache::lonnet::critical('put:'.
                              $ENV{'course.'.$cid.'.domain'}.':'.
 	                     $ENV{'course.'.$cid.'.num'}.':classlist:'.
                          &Apache::lonnet::escape($ENV{'form.ccuname'}.':'.
                              $ENV{'form.ccdomain'}).'='.
                          &Apache::lonnet::escape($now.':'),
-	                     $ENV{'course.'.$cid.'.home'}).'<br>');
+	                     $ENV{'course.'.$cid.'.home'}).'</b><br>');
 		}
 	    } 
 	} elsif ($_=~/^form\.del/) {
@@ -748,14 +752,14 @@
 		if ($2 eq 'st') {
 		    $1=~/^\/(\w+)\/(\w+)/;
 		    my $cid=$1.'_'.$2;
-		    $r->print('Drop from classlist: '.
+		    $r->print('Drop from classlist: <b>'.
 			 &Apache::lonnet::critical('put:'.
                              $ENV{'course.'.$cid.'.domain'}.':'.
 	                     $ENV{'course.'.$cid.'.num'}.':classlist:'.
                          &Apache::lonnet::escape($ENV{'form.ccuname'}.':'.
                              $ENV{'form.ccdomain'}).'='.
                          &Apache::lonnet::escape($now.':'),
-	                     $ENV{'course.'.$cid.'.home'}).'<br>');
+	                     $ENV{'course.'.$cid.'.home'}).'</b><br>');
 		}
 	    } 
 	} elsif ($_=~/^form\.act/) {
@@ -776,16 +780,16 @@
 		# Assign the role and report it
 		$r->print('Assigning: '.$3.' in '.$url.
                          ($start?', starting '.localtime($start):'').
-                         ($end?', ending '.localtime($end):'').': '.
+                         ($end?', ending '.localtime($end):'').': <b>'.
                           &Apache::lonnet::assignrole(
                               $ENV{'form.ccdomain'},$ENV{'form.ccuname'},
                               $url,$3,$end,$start).
-			  '<br>');
+			  '</b><br>');
 		# Handle students differently
 		if ($3 eq 'st') {
 		    $url=~/^\/(\w+)\/(\w+)/;
 		    my $cid=$1.'_'.$2;
-		    $r->print('Add to classlist: '.
+		    $r->print('Add to classlist: <b>'.
 			      &Apache::lonnet::critical(
 				  'put:'.$ENV{'course.'.$cid.'.domain'}.':'.
 	                           $ENV{'course.'.$cid.'.num'}.':classlist:'.
@@ -794,7 +798,7 @@
                                        $ENV{'form.ccdomain'} ).'='.
                                    &Apache::lonnet::escape($end.':'.$start),
 				       $ENV{'course.'.$cid.'.home'})
-			      .'<br>');
+			      .'</b><br>');
 		}
 	    } elsif ($_=~/^form\.act\_([^\_]+)\_([^\_]+)$/) {
 		# Activate roles for sections with two id numbers
@@ -808,10 +812,12 @@
 		my $url='/'.$1.'/';
 		# Assign the role and report it.
 		$r->print('Assigning: '.$2.' in '.$url.': '.
+                         ($start?', starting '.localtime($start):'').
+                         ($end?', ending '.localtime($end):'').': <b>'.
                           &Apache::lonnet::assignrole(
                               $ENV{'form.ccdomain'},$ENV{'form.ccuname'},
                               $url,$2,$end,$start)
-			  .'<br>');
+			  .'</b><br>');
 	    }
 	} 
     } # End of foreach (keys(%ENV))