version 1.188, 2008/05/12 23:47:37
|
version 1.190, 2008/05/14 22:26:48
|
Line 137 sub handler {
|
Line 137 sub handler {
|
# Is this an ad-hoc CC-role? |
# Is this an ad-hoc CC-role? |
if (my ($domain,$coursenum) = |
if (my ($domain,$coursenum) = |
($envkey =~ m-^form\.cc\./($match_domain)/($match_courseid)$-)) { |
($envkey =~ m-^form\.cc\./($match_domain)/($match_courseid)$-)) { |
|
# See if that is even allowed |
|
my %crsenv=&Apache::lonnet::get('environment',['internal.courseowner'],$domain,$coursenum); |
|
# First find course owner |
|
my ($owneruser,$ownerdomain)=split(/\:/,$crsenv{'internal.courseowner'}); |
|
# Check if course owner blocked cc-access |
|
if (($owneruser) && ($ownerdomain)) { |
|
my %blocked=&Apache::lonnet::get('environment',['domcoord.cc'],$ownerdomain,$owneruser); |
|
if ($blocked{'domcoord.cc'} eq 'blocked') { |
|
$env{'user.error.msg'}=':::1:Course owner '.$owneruser.' in domain '.$ownerdomain.' blocked domain coordinator access'; |
|
last; |
|
} |
|
} |
if ($dcroles{$domain}) { |
if ($dcroles{$domain}) { |
&check_privs($domain,$coursenum,$then,$now,'cc'); |
&check_privs($domain,$coursenum,$then,$now,'cc'); |
} |
} |
Line 145 sub handler {
|
Line 157 sub handler {
|
# Is this a recent ad-hoc CA-role? |
# Is this a recent ad-hoc CA-role? |
if (my ($domain,$user) = |
if (my ($domain,$user) = |
($envkey =~ m-^form\.ca\./($match_domain)/($match_username)$-)) { |
($envkey =~ m-^form\.ca\./($match_domain)/($match_username)$-)) { |
|
# See if still allowed |
|
my %blocked=&Apache::lonnet::get('environment',['domcoord.author'],$domain,$user); |
|
if ($blocked{'domcoord.author'} eq 'blocked') { |
|
delete($env{$envkey}); |
|
$env{'user.error.msg'}=':::1:User '.$user.' in domain '.$domain.' blocked domain coordinator access'; |
|
last; |
|
} |
if (($dcroles{$domain}) && (&is_author_homeserver($user,$domain))) { |
if (($dcroles{$domain}) && (&is_author_homeserver($user,$domain))) { |
&check_privs($domain,$user,$then,$now,'ca'); |
&check_privs($domain,$user,$then,$now,'ca'); |
} else { |
} else { |
Line 155 sub handler {
|
Line 174 sub handler {
|
# Is this a new ad-hoc CA-role? |
# Is this a new ad-hoc CA-role? |
if (my ($domain) = |
if (my ($domain) = |
($envkey =~ m-^form\.adhocca\./($match_domain)$-)) { |
($envkey =~ m-^form\.adhocca\./($match_domain)$-)) { |
|
my $user=$env{'form.adhoccauname.'.$domain}; |
|
if (!$user) { $user=$env{'form.adhoccaunamerecent.'.$domain} }; |
|
# See if that is even allowed |
|
my %blocked=&Apache::lonnet::get('environment',['domcoord.author'],$domain,$user); |
|
if ($blocked{'domcoord.author'} eq 'blocked') { |
|
$env{'user.error.msg'}=':::1:User '.$user.' in domain '.$domain.' blocked domain coordinator access'; |
|
last; |
|
} |
if ($dcroles{$domain}) { |
if ($dcroles{$domain}) { |
my $user=$env{'form.adhoccauname.'.$domain}; |
|
if (!$user) { $user=$env{'form.adhoccaunamerecent.'.$domain} }; |
|
if (($user) && ($user=~/$match_username/) && (&is_author_homeserver($user,$domain))) { |
if (($user) && ($user=~/$match_username/) && (&is_author_homeserver($user,$domain))) { |
&check_privs($domain,$user,$then,$now,'ca'); |
&check_privs($domain,$user,$then,$now,'ca'); |
$env{'form.ca./'.$domain.'/'.$user}=1; |
$env{'form.ca./'.$domain.'/'.$user}=1; |