--- loncom/interface/loncreateuser.pm 2003/06/19 21:46:38 1.55 +++ loncom/interface/loncreateuser.pm 2003/07/17 18:10:53 1.57 @@ -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.57 2003/07/17 18:10:53 matthew 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.57 2003/07/17 18:10:53 matthew Exp $ ### package Apache::loncreateuser; @@ -286,12 +286,15 @@ END my $allowed=0; my $delallowed=0; if ($area =~ /^\/(\w+)\/(\d\w+)/ ) { + my ($coursedom,$coursedir) = ($1,$2); + # $1.'_'.$2 is the course id (eg. 103_12345abcef103l3). my %coursedata= &Apache::lonnet::coursedescription($1.'_'.$2); my $carea; if (defined($coursedata{'description'})) { $carea='Course: '.$coursedata{'description'}. - '
Domain: '.$1; + '
Domain: '.$coursedom.(' 'x8). + &Apache::loncommon::syllabuswrapper('Syllabus',$coursedir,$coursedom); } else { $carea='Unavailable course: '.$area; } @@ -345,7 +348,11 @@ END if (($active) && ($allowed)) { $row.= ''; } else { - $row.=' '; + if ($active) { + $row.=' '; + } else { + $row.='expired or revoked'; + } } $row.=''; if ($delallowed) { @@ -724,20 +731,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,14 +755,14 @@ 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/) { @@ -776,16 +783,16 @@ END # Assign the role and report it $r->print('Assigning: '.$3.' in '.$url. ($start?', starting '.localtime($start):''). - ($end?', ending '.localtime($end):'').': '. + ($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:'. @@ -794,7 +801,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 @@ -808,10 +815,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))