--- loncom/auth/lonroles.pm 2004/11/12 23:29:55 1.109 +++ loncom/auth/lonroles.pm 2005/03/03 07:32:49 1.117 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.109 2004/11/12 23:29:55 raeburn Exp $ +# $Id: lonroles.pm,v 1.117 2005/03/03 07:32:49 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -100,21 +100,13 @@ sub handler { "request.role.adv" => $ENV{'user.adv'}, "request.role.domain" => $ENV{'user.domain'}); -# Check to see if the user is a DC trying to enter a course and needs privs to be created +# Check if user is a DC trying to enter a course and needs privs to be created if ($numdc > 0) { foreach my $envkey (keys %ENV) { if ($envkey =~ m-^form\.cc\./(\w+)/(\w+)$-) { if ($dcroles{$1}) { my $cckey = 'user.role.cc./'.$1.'/'.$2; - if ($ENV{$cckey}) { - my ($role,$where,$trolecode,$tstart,$tend,$tremark,$tstatus,$tpstart,$tpend,$tfont); - &role_status($cckey,$then,$now,\$role,\$where,\$trolecode,\$tstatus,\$tstart,\$tend); - unless (($tstatus eq 'is') || ($tstatus eq 'will_not')) { - &set_privileges($1,$2); - } - } else { - &set_privileges($1,$2); - } + &check_privs($cckey,$then,$now); } last; } @@ -129,6 +121,13 @@ sub handler { if ($tstatus eq 'is') { $where=~s/^\///; my ($cdom,$cnum,$csec)=split(/\//,$where); +# store role if recent_role list being kept + if ($ENV{'environment.recentroles'}) { + &Apache::lonhtmlcommon::store_recent('roles', + $trolecode,' '); + } + + # check for keyed access if (($role eq 'st') && ($ENV{'course.'.$cdom.'_'.$cnum.'.keyaccess'} eq 'yes')) { @@ -225,9 +224,6 @@ ENDENTERKEY 'request.role.domain' => $cdom, 'request.course.sec' => $csec); my $tadv=0; - if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; } - &Apache::lonnet::appenv('request.role.adv' => $tadv); - my $msg=&mt('Entering course ...'); if (($cnum) && ($role ne 'ca')) { @@ -239,6 +235,8 @@ ENDENTERKEY if ( &Apache::lonnet::mod_perl_version() == 2 ) { &Apache::lonnet::cleanenv(); } + if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; } + &Apache::lonnet::appenv('request.role.adv'=>$tadv); $r->internal_redirect($dest); return OK; } else { @@ -251,6 +249,8 @@ ENDENTERKEY &mt('Could not initialize course at this time.'). '
Access : ". Apache::lonnet::plaintext($priv)."\n"); - $r->print("Resource: $fn\n"); + $r->print("Resource: ".&Apache::lonenc::check_encrypt($fn)."\n"); $r->print("Action : $msg\n