--- loncom/interface/loncreateuser.pm 2001/03/19 19:54:37 1.9 +++ loncom/interface/loncreateuser.pm 2001/04/25 20:33:26 1.16 @@ -16,7 +16,7 @@ # # 2/14 Gerd Kortemeyer) # -# 2/14,2/17,2/19,2/20,2/21,2/22,2/23,3/2,3/17 Gerd Kortemeyer +# 2/14,2/17,2/19,2/20,2/21,2/22,2/23,3/2,3/17,3/24,04/12 Gerd Kortemeyer # package Apache::loncreateuser; @@ -108,7 +108,9 @@ ENDENHEAD my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain); my %incdomains; my %inccourses; - $incdomains{$ENV{'user.domain'}}=1; + map { + $incdomains{$_}=1; + } values %Apache::lonnet::hostdom; map { if ($_=~/^user\.priv\.cm\.\/(\w+)\/(\w+)/) { $inccourses{$1.'_'.$2}=1; @@ -194,7 +196,6 @@ ENDNUSER $area=$carea; } else { if ($area=~/^\/(\w+)\//) { - $incdomains{$1}=1; if (&Apache::lonnet::allowed('c'.$trole,$1)) { $allows=1; } @@ -228,7 +229,7 @@ ENDNUSER $r->print(''); } } - $r->print('

Add Roles

System Level

'); + $r->print('

Add Roles

'); # # Domain level # @@ -254,7 +255,7 @@ ENDNUSER ENDDROW } - } ('dc','cc','li','dg','au'); + } ('dc','li','dg','au'); } sort keys %incdomains; $r->print(''); # @@ -265,6 +266,8 @@ ENDDROW 'Group/SectionStartEnd'); map { my $thiscourse=$_; + my $protectedcourse=$_; + $thiscourse=~s:_:/:g; my %coursedata=&Apache::lonnet::coursedescription($thiscourse); my $area=$coursedata{'description'}; my $bgcol=$thiscourse; @@ -273,23 +276,26 @@ ENDDROW map { if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) { my $plrole=&Apache::lonnet::plaintext($_); - $r->print(<print(" - + $plrole $area - - +"); + if ($_ ne 'cc') { + $r->print(""); + } else { $r->print(" "); } + $r->print(< Set Start Date - +"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$protectedcourse\_$_.value,'start_$protectedcourse\_$_','cu.pres','dateset')">Set Start Date + Set End Date +"javascript:pjump('date_end','End Date $plrole',document.cu.end_$protectedcourse\_$_.value,'end_$protectedcourse\_$_','cu.pres','dateset')">Set End Date ENDROW - } - } ('st','ta','ep','ad','in'); + } ('st','ta','ep','ad','in','cc'); } sort keys %inccourses; $r->print(''); $r->print(''); @@ -346,6 +352,17 @@ ENDTHREEHEAD $r->print('Revoking '.$2.' in '.$1.': '. &Apache::lonnet::assignrole($ENV{'form.cdomain'},$ENV{'form.cuname'}, $1,$2,$now).'
'); + if ($2 eq 'st') { + $1=~/^\/(\w+)\/(\w+)/; + my $cid=$1.'_'.$2; + $r->print('Drop from classlist: '. + &Apache::lonnet::critical('put:'.$ENV{'course.'.$cid.'.domain'}.':'. + $ENV{'course.'.$cid.'.num'}.':classlist:'. + &Apache::lonnet::escape($ENV{'form.cuname'}.':'. + $ENV{'form.cdomain'}).'='. + &Apache::lonnet::escape($now.':'), + $ENV{'course.'.$cid.'.home'}).'
'); + } } } keys %ENV; map { @@ -365,6 +382,17 @@ ENDTHREEHEAD $r->print('Assigning: '.$3.' in '.$url.': '. &Apache::lonnet::assignrole($ENV{'form.cdomain'},$ENV{'form.cuname'}, $url,$3,$end,$start).'
'); + if ($3 eq 'st') { + $url=~/^\/(\w+)\/(\w+)/; + my $cid=$1.'_'.$2; + $r->print('Add to classlist: '. + &Apache::lonnet::critical('put:'.$ENV{'course.'.$cid.'.domain'}.':'. + $ENV{'course.'.$cid.'.num'}.':classlist:'. + &Apache::lonnet::escape($ENV{'form.cuname'}.':'. + $ENV{'form.cdomain'}).'='. + &Apache::lonnet::escape($end.':'.$start), + $ENV{'course.'.$cid.'.home'}).'
'); + } } elsif (($_=~/^form\.act\_([^\_]+)\_([^\_]+)$/) && ($ENV{$_})) { my $url='/'.$1.'/'; my $start=$now;