version 1.144, 2006/01/06 21:03:23
|
version 1.146, 2006/03/16 19:19:59
|
Line 108 sub handler {
|
Line 108 sub handler {
|
# Check if 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) { |
if ($numdc > 0) { |
foreach my $envkey (keys %env) { |
foreach my $envkey (keys %env) { |
if ($envkey =~ m-^form\.cc\./(\w+)/(\w+)$-) { |
if (my ($domain,$coursenum) = |
if ($dcroles{$1}) { |
($envkey =~ m-^form\.cc\./(\w+)/(\w+)$-)) { |
my $cckey = 'user.role.cc./'.$1.'/'.$2; |
if ($dcroles{$domain}) { |
&check_privs($cckey,$then,$now); |
&check_privs($domain,$coursenum,$then,$now); |
} |
} |
last; |
last; |
} |
} |
Line 273 ENDENTERKEY
|
Line 273 ENDENTERKEY
|
# Send the user to the course they selected |
# Send the user to the course they selected |
} elsif ($env{'request.course.id'}) { |
} elsif ($env{'request.course.id'}) { |
if (&Apache::lonnet::allowed('whn', |
if (&Apache::lonnet::allowed('whn', |
$env{'request.course.id'})) { |
$env{'request.course.id'}) |
|
|| &Apache::lonnet::allowed('whn', |
|
$env{'request.course.id'}.'/' |
|
.$env{'request.course.sec'}) |
|
) { |
my $startpage = &courseloadpage($courseid); |
my $startpage = &courseloadpage($courseid); |
unless ($startpage eq 'firstres') { |
unless ($startpage eq 'firstres') { |
$msg = &mt('Entering course ....'); |
$msg = &mt('Entering course ....'); |
Line 843 sub build_roletext {
|
Line 847 sub build_roletext {
|
} |
} |
|
|
sub check_privs { |
sub check_privs { |
my ($cckey,$then,$now) = @_; |
my ($cdom,$cnum,$then,$now) = @_; |
|
my $cckey = 'user.role.cc./'.$cdom.'/'.$cnum; |
if ($env{$cckey}) { |
if ($env{$cckey}) { |
my ($role,$where,$trolecode,$tstart,$tend,$tremark,$tstatus,$tpstart,$tpend,$tfont); |
my ($role,$where,$trolecode,$tstart,$tend,$tremark,$tstatus,$tpstart,$tpend,$tfont); |
&role_status($cckey,$then,$now,\$role,\$where,\$trolecode,\$tstatus,\$tstart,\$tend); |
&role_status($cckey,$then,$now,\$role,\$where,\$trolecode,\$tstatus,\$tstart,\$tend); |
unless (($tstatus eq 'is') || ($tstatus eq 'will_not')) { |
unless (($tstatus eq 'is') || ($tstatus eq 'will_not')) { |
&set_privileges($1,$2); |
&set_privileges($cdom,$cnum); |
} |
} |
} else { |
} else { |
&set_privileges($1,$2); |
&set_privileges($cdom,$cnum); |
} |
} |
} |
} |
|
|
Line 1018 sub set_privileges {
|
Line 1023 sub set_privileges {
|
$env{'user.home'}, |
$env{'user.home'}, |
"Role ".$role); |
"Role ".$role); |
&Apache::lonnet::appenv( |
&Apache::lonnet::appenv( |
'request.role' => $role, |
'request.role' => $spec, |
'request.role.domain' => $dcdom, |
'request.role.domain' => $dcdom, |
'request.course.sec' => ''); |
'request.course.sec' => ''); |
my $tadv=0; |
my $tadv=0; |