--- loncom/interface/loncreateuser.pm 2003/04/30 15:49:45 1.52 +++ loncom/interface/loncreateuser.pm 2003/05/10 23:06:52 1.53 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.52 2003/04/30 15:49:45 matthew Exp $ +# $Id: loncreateuser.pm,v 1.53 2003/05/10 23:06:52 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.52 2003/04/30 15:49:45 matthew Exp $ +# $Id: loncreateuser.pm,v 1.53 2003/05/10 23:06:52 www Exp $ ### package Apache::loncreateuser; @@ -254,7 +254,7 @@ END foreach ('firstname','middlename','lastname','generation') { if (&Apache::lonnet::allowed('mau',$ccdomain)) { $r->print(<<"END"); - + END } else { $r->print(''.$userenv{$_}.''); @@ -272,7 +272,7 @@ END

Revoke Existing Roles

- + END foreach my $area (keys(%rolesdump)) { next if ($area =~ /^rolesdef/); @@ -283,19 +283,26 @@ END split(/_/,$role); my $bgcol='ffffff'; my $allowed=0; + my $delallowed=0; if ($area =~ /^\/(\w+)\/(\d\w+)/ ) { my %coursedata= &Apache::lonnet::coursedescription($1.'_'.$2); my $carea; if (defined($coursedata{'description'})) { - $carea='Course: '.$coursedata{'description'}; + $carea='Course: '.$coursedata{'description'}. + '
Domain: '.$1; } else { $carea='Unavailable course: '.$area; } $inccourses{$1.'_'.$2}=1; - if (&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) { + if ((&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) || + (&Apache::lonnet::allowed('c'.$role_code,$ccdomain))) { $allowed=1; } + if ((&Apache::lonnet::allowed('dro',$1)) || + (&Apache::lonnet::allowed('dro',$ccdomain))) { + $delallowed=1; + } # Compute the background color based on $area $bgcol=$1.'_'.$2; $bgcol=~s/[^8-9b-e]//g; @@ -307,9 +314,15 @@ END } else { # Determine if current user is able to revoke privileges if ($area=~ /^\/(\w+)\//) { - if (&Apache::lonnet::allowed('c'.$role_code,$1)) { + if ((&Apache::lonnet::allowed('c'.$role_code,$1)) || + (&Apache::lonnet::allowed('c'.$role_code,$ccdomain))) { $allowed=1; } + if (((&Apache::lonnet::allowed('dro',$1)) || + (&Apache::lonnet::allowed('dro',$ccdomain))) && + ($role_code ne 'dc')) { + $delallowed=1; + } } else { if (&Apache::lonnet::allowed('c'.$role_code,'/')) { $allowed=1; @@ -333,6 +346,12 @@ END } else { $row.=' '; } + $row.=' - - - - - -
RevokeRoleExtentStartEnd
RevokeDeleteRoleExtentStartEnd'; + if ($delallowed) { + $row.= ''; + } else { + $row.=' '; + } $row.= ''.&Apache::lonnet::plaintext($role_code). ''.$area. ''.($role_start_time?localtime($role_start_time) @@ -412,16 +431,7 @@ ENDBADAUTH $authform_other="

$authformkrb

". "

$authformint

$authformfsys

"; } - $authformcurrent=< -
* * * WARNING * * ** * * WARNING * * *
$authformcurrentChanging this value will overwrite existing authentication for the user; you should notify the user of this change.
-ENDCURRENTAUTH + $authformcurrent.=' (will override current values)
'; if (&Apache::lonnet::allowed('mau',$ENV{'request.role.domain'})) { # Current user has login modification privileges $r->print(<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'}).'
'); + } + } + } elsif ($_=~/^form\.del/) { + if ($_=~/^form\.del\:([^\_]+)\_([^\_]+)$/) { + $r->print('Deleting '.$2.' in '.$1.': '. + &Apache::lonnet::assignrole($ENV{'form.ccdomain'}, + $ENV{'form.ccuname'},$1,$2,$now,0,1).'
'); + if ($2 eq 'st') { + $1=~/^\/(\w+)\/(\w+)/; + my $cid=$1.'_'.$2; $r->print('Drop from classlist: '. &Apache::lonnet::critical('put:'. $ENV{'course.'.$cid.'.domain'}.':'.