$lt{'preamble'} $lt{$type}
$lt{'miss'}
$lt{'proctor'}
-
@@ -1740,7 +1810,7 @@ END
@@ -2029,7 +2099,7 @@ sub roles_selector {
my ($cdom,$cnum,$httphost) = @_;
my $crstype = &Apache::loncommon::course_type();
my $now = time;
- my (%courseroles,%seccount,%courseprivs);
+ my (%courseroles,%seccount,%courseprivs,%roledesc);
my $is_cc;
my ($js,$form,$switcher);
my $ccrole;
@@ -2038,7 +2108,7 @@ sub roles_selector {
} else {
$ccrole = 'cc';
}
- my ($priv,$gotsymb,$destsymb);
+ my ($privref,$gotsymb,$destsymb);
my $destinationurl = $ENV{'REQUEST_URI'};
if ($destinationurl =~ /\?symb=/) {
$gotsymb = 1;
@@ -2059,12 +2129,15 @@ sub roles_selector {
my $destination = $destinationurl;
$destination =~ s/(\?.*)$//;
if (exists($reqprivs->{$destination})) {
- $priv = $reqprivs->{$destination};
+ if ($reqprivs->{$destination} =~ /,/) {
+ @{$privref} = split(/,/,$reqprivs->{$destination});
+ } else {
+ $privref = [$reqprivs->{$destination}];
+ }
}
}
if ($env{'user.role.'.$ccrole.'./'.$cdom.'/'.$cnum}) {
my ($start,$end) = split(/\./,$env{'user.role.'.$ccrole.'./'.$cdom.'/'.$cnum});
-
if ((($start) && ($start<0)) ||
(($end) && ($end<$now)) ||
(($start) && ($now<$start))) {
@@ -2074,7 +2147,9 @@ sub roles_selector {
}
}
if ($is_cc) {
- &get_all_courseroles($cdom,$cnum,\%courseroles,\%seccount,\%courseprivs,$priv);
+ &get_all_courseroles($cdom,$cnum,\%courseroles,\%seccount,\%courseprivs);
+ } elsif ($env{'request.role'} =~ m{^\Qcr/$cdom/$cdom-domainconfig/\E(\w+)\.\Q/$cdom/$cnum\E}) {
+ &get_customadhoc_roles($cdom,$cnum,\%courseroles,\%seccount,\%courseprivs,\%roledesc,$privref);
} else {
my %gotnosection;
foreach my $item (keys(%env)) {
@@ -2090,7 +2165,7 @@ sub roles_selector {
$gotnosection{$role} = 1;
}
}
- if ($priv ne '') {
+ if ((ref($privref) eq 'ARRAY') && (@{$privref} > 0)) {
my $cnumsec = $cnum;
if ($sec ne '') {
$cnumsec .= "/$sec";
@@ -2128,7 +2203,7 @@ sub roles_selector {
}
if ((keys(%seccount) > 1) || ($numdiffsec > 1)) {
my @submenu;
- $js = &jump_to_role($cdom,$cnum,\%seccount,\%courseroles,\%courseprivs,$priv);
+ $js = &jump_to_role($cdom,$cnum,\%seccount,\%courseroles,\%courseprivs,\%roledesc,$privref);
$form =
'