--- loncom/auth/lonroles.pm 2010/01/02 19:14:29 1.231.4.9 +++ loncom/auth/lonroles.pm 2010/01/02 19:20:28 1.231.4.10 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.231.4.9 2010/01/02 19:14:29 raeburn Exp $ +# $Id: lonroles.pm,v 1.231.4.10 2010/01/02 19:20:28 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -243,12 +243,12 @@ sub handler { # 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) { -# Is this an ad-hoc CC-role? - if (my ($domain,$coursenum) = - ($envkey =~ m-^form\.cc\./($match_domain)/($match_courseid)$-)) { +# Is this an ad-hoc Coordinator role? + if (my ($ccrole,$domain,$coursenum) = + ($envkey =~ m-^form\.(cc|co)\./($match_domain)/($match_courseid)$-)) { if ($dcroles{$domain}) { &Apache::lonnet::check_adhoc_privs($domain,$coursenum, - $then,$refresh,$now,'cc'); + $then,$refresh,$now,$ccrole); } last; } @@ -479,8 +479,8 @@ ENDENTERKEY $courseid = substr($courseid, 1); } $courseid =~ s/\//_/; - if ($role eq 'cc' && $env{'course.' . $courseid . - '.course.helper.not.run'}) { + if ((($role eq 'cc') || ($role eq 'co')) + && ($env{'course.' . $courseid .'.course.helper.not.run'})) { $furl = "/adm/helper/course.initialization.helper"; # Send the user to the course they selected } elsif ($env{'request.course.id'}) { @@ -1585,9 +1585,10 @@ sub display_cc_role { my $advanced = $env{'user.adv'}; my $tryagain = $env{'form.tryagain'}; unless ($rolekey =~/^error\:/) { - if ($rolekey =~ m-^user\.role.cc\./($match_domain)/($match_courseid)$-) { - my $tcourseid = $1.'_'.$2; - my $trolecode = 'cc./'.$1.'/'.$2; + if ($rolekey =~ m-^user\.role.(cc|co)\./($match_domain)/($match_courseid)$-) { + my $ccrole = $1; + my $tcourseid = $2.'_'.$3; + my $trolecode = $1.'./'.$2.'/'.$3; my $twhere; my $ttype; my $tbg='LC_roles_is'; @@ -1602,7 +1603,7 @@ sub display_cc_role { $twhere=&mt('Currently not available'); $env{'course.'.$tcourseid.'.description'}=$twhere; } - my $trole = &Apache::lonnet::plaintext('cc',$ttype); + my $trole = &Apache::lonnet::plaintext($ccrole,$ttype); $twhere.="
".&mt('Domain').":".$1; ($roletext,$roletext_end) = &build_roletext($trolecode,$1,$2,'is',$tryagain,$advanced,'',$tbg,$trole,$twhere,'','','',1,''); }