--- loncom/interface/loncreateuser.pm 2003/06/04 19:48:19 1.54 +++ loncom/interface/loncreateuser.pm 2003/06/20 14:37:26 1.56 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.54 2003/06/04 19:48:19 bowersj2 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.54 2003/06/04 19:48:19 bowersj2 Exp $ +# $Id: loncreateuser.pm,v 1.56 2003/06/20 14:37:26 www Exp $ ### package Apache::loncreateuser; @@ -345,7 +345,11 @@ END if (($active) && ($allowed)) { $row.= ''; } else { - $row.=' '; + if ($active) { + $row.=' '; + } else { + $row.='expired or revoked'; + } } $row.=''; if ($delallowed) { @@ -724,20 +728,20 @@ END # Revoke roles if ($_=~/^form\.rev/) { if ($_=~/^form\.rev\:([^\_]+)\_([^\_]+)$/) { - $r->print('Revoking '.$2.' in '.$1.': '. + $r->print('Revoking '.$2.' in '.$1.': '. &Apache::lonnet::assignrole($ENV{'form.ccdomain'}, - $ENV{'form.ccuname'},$1,$2,$now).'
'); + $ENV{'form.ccuname'},$1,$2,$now).'

'); if ($2 eq 'st') { $1=~/^\/(\w+)\/(\w+)/; my $cid=$1.'_'.$2; - $r->print('Drop from classlist: '. + $r->print('Drop from classlist: '. &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'}).'
'); + $ENV{'course.'.$cid.'.home'}).'

'); } } } elsif ($_=~/^form\.del/) { @@ -748,41 +752,44 @@ END if ($2 eq 'st') { $1=~/^\/(\w+)\/(\w+)/; my $cid=$1.'_'.$2; - $r->print('Drop from classlist: '. + $r->print('Drop from classlist: '. &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'}).'
'); + $ENV{'course.'.$cid.'.home'}).'

'); } } } elsif ($_=~/^form\.act/) { if ($_=~/^form\.act\_([^\_]+)\_([^\_]+)\_([^\_]+)$/) { # Activate roles for sections with 3 id numbers # set start, end times, and the url for the class - my $start = ( $ENV{'form.start_'.$1.'_'.$2} ? - $ENV{'form.start_'.$1.'_'.$2} : + + my $start = ( $ENV{'form.start_'.$1.'_'.$2.'_'.$3} ? + $ENV{'form.start_'.$1.'_'.$2.'_'.$3} : $now ); - my $end = ( $ENV{'form.end_'.$1.'_'.$2} ? - $ENV{'form.end_'.$1.'_'.$2} : + my $end = ( $ENV{'form.end_'.$1.'_'.$2.'_'.$3} ? + $ENV{'form.end_'.$1.'_'.$2.'_'.$3} : 0 ); my $url='/'.$1.'/'.$2; if ($ENV{'form.sec_'.$1.'_'.$2.'_'.$3}) { $url.='/'.$ENV{'form.sec_'.$1.'_'.$2.'_'.$3}; } # Assign the role and report it - $r->print('Assigning: '.$3.' in '.$url.': '. + $r->print('Assigning: '.$3.' in '.$url. + ($start?', starting '.localtime($start):''). + ($end?', ending '.localtime($end):'').': '. &Apache::lonnet::assignrole( $ENV{'form.ccdomain'},$ENV{'form.ccuname'}, $url,$3,$end,$start). - '
'); + '

'); # Handle students differently if ($3 eq 'st') { $url=~/^\/(\w+)\/(\w+)/; my $cid=$1.'_'.$2; - $r->print('Add to classlist: '. + $r->print('Add to classlist: '. &Apache::lonnet::critical( 'put:'.$ENV{'course.'.$cid.'.domain'}.':'. $ENV{'course.'.$cid.'.num'}.':classlist:'. @@ -791,7 +798,7 @@ END $ENV{'form.ccdomain'} ).'='. &Apache::lonnet::escape($end.':'.$start), $ENV{'course.'.$cid.'.home'}) - .'
'); + .'

'); } } elsif ($_=~/^form\.act\_([^\_]+)\_([^\_]+)$/) { # Activate roles for sections with two id numbers @@ -805,10 +812,12 @@ END my $url='/'.$1.'/'; # Assign the role and report it. $r->print('Assigning: '.$2.' in '.$url.': '. + ($start?', starting '.localtime($start):''). + ($end?', ending '.localtime($end):'').': '. &Apache::lonnet::assignrole( $ENV{'form.ccdomain'},$ENV{'form.ccuname'}, $url,$2,$end,$start) - .'
'); + .'

'); } } } # End of foreach (keys(%ENV))