version 1.314, 2016/05/04 05:14:49
|
version 1.315, 2016/10/05 13:30:16
|
Line 264 sub handler {
|
Line 264 sub handler {
|
my $locknum=&Apache::lonnet::get_locks(); |
my $locknum=&Apache::lonnet::get_locks(); |
if ($locknum) { return 409; } |
if ($locknum) { return 409; } |
|
|
|
my $custom_adhoc; |
if ($env{'form.newrole'}) { |
if ($env{'form.newrole'}) { |
$env{'form.'.$env{'form.newrole'}}=1; |
$env{'form.'.$env{'form.newrole'}}=1; |
|
# Check if this is a Domain Helpdesk role trying to enter a course |
|
if ($env{'form.newrole'} =~ m{^cr/($match_domain)/\1\-domainconfig/\w+\./\1/$match_courseid$}) { |
|
if (&Apache::lonnet::allowed('rar',$1)) { |
|
$custom_adhoc = 1; |
|
} |
|
} |
} |
} |
if ($env{'request.course.id'}) { |
if ($env{'request.course.id'}) { |
# Check if user is CC trying to select a course role |
# Check if user is CC trying to select a course role |
Line 296 sub handler {
|
Line 303 sub handler {
|
"request.role" => 'cm', |
"request.role" => 'cm', |
"request.role.adv" => $env{'user.adv'}, |
"request.role.adv" => $env{'user.adv'}, |
"request.role.domain" => $env{'user.domain'}}); |
"request.role.domain" => $env{'user.domain'}}); |
|
# Check if Domain Helpdesk role trying to enter a course needs privs to be created |
|
if ($env{'form.newrole'} =~ m{^cr/($match_domain)/\1\-domainconfig/(\w+)\./\1/($match_courseid)$}) { |
|
my $cdom = $1; |
|
my $rolename = $2; |
|
my $cnum = $3; |
|
if ($custom_adhoc) { |
|
my %adhocroles = &Apache::lonnet::userenvironment($env{'user.domain'},$env{'user.name'}, |
|
'adhocroles.'.$cdom); |
|
if (keys(%adhocroles)) { |
|
my @adhoc = split(',',$adhocroles{'adhocroles.'.$cdom}); |
|
if (grep(/^\Q$rolename\E$/,@adhoc)) { |
|
if (&Apache::lonnet::check_adhoc_privs($cdom,$cnum,$update,$refresh,$now, |
|
"cr/$cdom/$cdom".'-domainconfig/'.$rolename)) { |
|
&Apache::lonnet::appenv({"environment.internal.$cdom.$cnum.cr/$cdom/$cdom".'-domainconfig'."$rolename.adhoc" => time}); |
|
} |
|
} |
|
} |
|
} |
|
} elsif ($numdc > 0) { |
# Check if user is a DC trying to enter a course or author space and needs privs to be created |
# Check if user is a DC trying to enter a course or author space and needs privs to be created |
if ($numdc > 0) { |
|
foreach my $envkey (keys(%env)) { |
foreach my $envkey (keys(%env)) { |
# Is this an ad-hoc Coordinator role? |
# Is this an ad-hoc Coordinator role? |
if (my ($ccrole,$domain,$coursenum) = |
if (my ($ccrole,$domain,$coursenum) = |
Line 716 ENDENTERKEY
|
Line 741 ENDENTERKEY
|
$redirect_url); |
$redirect_url); |
return OK; |
return OK; |
} |
} |
|
if ($role eq 'dh') { |
|
my $redirect_url = '/adm/menu/'; |
|
&redirect_user($r,&mt('Loading Domain Helpdesk Menu'), |
|
$redirect_url); |
|
return OK; |
|
} |
if ($role eq 'sc') { |
if ($role eq 'sc') { |
my $redirect_url = '/adm/grades?command=scantronupload'; |
my $redirect_url = '/adm/grades?command=scantronupload'; |
&redirect_user($r,&mt('Loading Data Upload Page'), |
&redirect_user($r,&mt('Loading Data Upload Page'), |