Diff for /loncom/auth/lonroles.pm between versions 1.239 and 1.240

version 1.239, 2009/10/31 05:44:35 version 1.240, 2009/11/03 03:01:47
Line 255  sub handler { Line 255  sub handler {
 # 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) {          if ($numdc > 0) {
             foreach my $envkey (keys %env) {              foreach my $envkey (keys %env) {
 # Is this an ad-hoc CC-role?  # Is this an ad-hoc Coordinator role?
                 if (my ($domain,$coursenum) =                  if (my ($ccrole,$domain,$coursenum) =
     ($envkey =~ m-^form\.cc\./($match_domain)/($match_courseid)$-)) {      ($envkey =~ m-^form\.(cc|co)\./($match_domain)/($match_courseid)$-)) {
                     if ($dcroles{$domain}) {                      if ($dcroles{$domain}) {
                         &Apache::lonnet::check_adhoc_privs($domain,$coursenum,                          &Apache::lonnet::check_adhoc_privs($domain,$coursenum,
                                                            $then,$refresh,$now,'cc');                                                             $then,$refresh,$now,$ccrole);
                     }                      }
                     last;                      last;
                 }                  }
Line 491  ENDENTERKEY Line 491  ENDENTERKEY
     $courseid = substr($courseid, 1);      $courseid = substr($courseid, 1);
  }   }
  $courseid =~ s/\//_/;   $courseid =~ s/\//_/;
  if ($role eq 'cc' && $env{'course.' . $courseid .    if ((($role eq 'cc') || ($role eq 'co')) 
       '.course.helper.not.run'}) {                                      && ($env{'course.' . $courseid .'.course.helper.not.run'})) { 
     $furl = "/adm/helper/course.initialization.helper";      $furl = "/adm/helper/course.initialization.helper";
     # 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'}) {
Line 1597  sub display_cc_role { Line 1597  sub display_cc_role {
     my $advanced = $env{'user.adv'};      my $advanced = $env{'user.adv'};
     my $tryagain = $env{'form.tryagain'};      my $tryagain = $env{'form.tryagain'};
     unless ($rolekey =~/^error\:/) {      unless ($rolekey =~/^error\:/) {
         if ($rolekey =~ m-^user\.role.cc\./($match_domain)/($match_courseid)$-) {          if ($rolekey =~ m{^user\.role\.(cc|co)\./($match_domain)/($match_courseid)$}) {
             my $tcourseid = $1.'_'.$2;              my $ccrole = $1;
             my $trolecode = 'cc./'.$1.'/'.$2;              my $tcourseid = $2.'_'.$3;
               my $trolecode = $1.'./'.$2.'/'.$3;
             my $twhere;              my $twhere;
             my $ttype;              my $ttype;
             my $tbg='LC_roles_is';              my $tbg='LC_roles_is';
Line 1614  sub display_cc_role { Line 1615  sub display_cc_role {
                 $twhere=&mt('Currently not available');                  $twhere=&mt('Currently not available');
                 $env{'course.'.$tcourseid.'.description'}=$twhere;                  $env{'course.'.$tcourseid.'.description'}=$twhere;
             }              }
             my $trole = &Apache::lonnet::plaintext('cc',$ttype);              my $trole = &Apache::lonnet::plaintext($ccrole,$ttype);
             $twhere.="<br />".&mt('Domain').":".$1;              $twhere.="<br />".&mt('Domain').":".$1;
             ($roletext,$roletext_end) = &build_roletext($trolecode,$1,$2,'is',$tryagain,$advanced,'',$tbg,$trole,$twhere,'','','',1,'');              ($roletext,$roletext_end) = &build_roletext($trolecode,$1,$2,'is',$tryagain,$advanced,'',$tbg,$trole,$twhere,'','','',1,'');
         }          }

Removed from v.1.239  
changed lines
  Added in v.1.240


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>