Diff for /loncom/interface/loncreateuser.pm between versions 1.140 and 1.141

version 1.140, 2006/12/01 21:00:35 version 1.141, 2006/12/01 21:52:29
Line 624  END Line 624  END
                my $delallowed=0;                 my $delallowed=0;
        my $sortkey=$role_code;         my $sortkey=$role_code;
        my $class='Unknown';         my $class='Unknown';
                if ($area =~ m{^/($match_domain)/($match_username)} ) {                 if ($area =~ m{^/($match_domain)/($match_courseid)} ) {
    $class='Course';     $class='Course';
                    my ($coursedom,$coursedir) = ($1,$2);                     my ($coursedom,$coursedir) = ($1,$2);
    $sortkey.="\0$coursedom";     $sortkey.="\0$coursedom";
Line 660  END Line 660  END
        }         }
    }     }
                    # Compute the background color based on $area                     # Compute the background color based on $area
                    if ($area=~m{^/($match_domain)/($match_username)/(\w+)}) {                     if ($area=~m{^/($match_domain)/($match_courseid)/(\w+)}) {
                        $carea.='<br />Section: '.$3;                         $carea.='<br />Section: '.$3;
        $sortkey.="\0$3";         $sortkey.="\0$3";
                    }                     }
Line 1274  END Line 1274  END
                      &Apache::lonnet::revokerole($env{'form.ccdomain'},                       &Apache::lonnet::revokerole($env{'form.ccdomain'},
                      $env{'form.ccuname'},$1,$2).'</b><br />');                       $env{'form.ccuname'},$1,$2).'</b><br />');
  if ($2 eq 'st') {   if ($2 eq 'st') {
     $1=~m{^/($match_domain)/($match_username)};      $1=~m{^/($match_domain)/($match_courseid)};
     my $cid=$1.'_'.$2;      my $cid=$1.'_'.$2;
     $r->print(&mt('Drop from classlist').': <b>'.      $r->print(&mt('Drop from classlist').': <b>'.
  &Apache::lonnet::critical('put:'.   &Apache::lonnet::critical('put:'.
Line 1301  END Line 1301  END
                      &Apache::lonnet::assignrole($env{'form.ccdomain'},                       &Apache::lonnet::assignrole($env{'form.ccdomain'},
                      $env{'form.ccuname'},$1,$2,$now,0,1).'<br />');                       $env{'form.ccuname'},$1,$2,$now,0,1).'<br />');
  if ($2 eq 'st') {   if ($2 eq 'st') {
     $1=~m{^/($match_domain)/($match_username)};      $1=~m{^/($match_domain)/($match_courseid)};
     my $cid=$1.'_'.$2;      my $cid=$1.'_'.$2;
     $r->print(&mt('Drop from classlist').': <b>'.      $r->print(&mt('Drop from classlist').': <b>'.
  &Apache::lonnet::critical('put:'.   &Apache::lonnet::critical('put:'.
Line 1332  END Line 1332  END
                 my $logmsg;                  my $logmsg;
                 my $output;                  my $output;
                 if ($role eq 'st') {                  if ($role eq 'st') {
                     if ($url =~ m-^/($match_domain)/($match_username)/?(\w*)$-) {                      if ($url =~ m-^/($match_domain)/($match_courseid)/?(\w*)$-) {
                         my $result = &Apache::loncommon::commit_studentrole(\$logmsg,$udom,$uname,$url,$role,$now,0,$1,$2,$3);                          my $result = &Apache::loncommon::commit_studentrole(\$logmsg,$udom,$uname,$url,$role,$now,0,$1,$2,$3);
                         if (($result =~ /^error/) || ($result eq 'not_in_class') || ($result eq 'unknown_course')) {                          if (($result =~ /^error/) || ($result eq 'not_in_class') || ($result eq 'unknown_course')) {
                             $output = "Error: $result\n";                              $output = "Error: $result\n";
Line 1363  END Line 1363  END
  } elsif ($key=~/^form\.act/) {   } elsif ($key=~/^form\.act/) {
             my $udom = $env{'form.ccdomain'};              my $udom = $env{'form.ccdomain'};
             my $uname = $env{'form.ccuname'};              my $uname = $env{'form.ccuname'};
     if ($key=~/^form\.act\_($match_domain)\_($match_username)\_cr_cr_($match_domain)_($match_username)_([^\_]+)$/) {      if ($key=~/^form\.act\_($match_domain)\_($match_courseid)\_cr_cr_($match_domain)_($match_username)_([^\_]+)$/) {
                 # Activate a custom role                  # Activate a custom role
  my ($one,$two,$three,$four,$five)=($1,$2,$3,$4,$5);   my ($one,$two,$three,$four,$five)=($1,$2,$3,$4,$5);
  my $url='/'.$one.'/'.$two;   my $url='/'.$one.'/'.$two;
Line 1394  END Line 1394  END
         $r->print(&Apache::loncommon::commit_customrole($udom,$uname,$securl,$three,$four,$five,$start,$end));          $r->print(&Apache::loncommon::commit_customrole($udom,$uname,$securl,$three,$four,$five,$start,$end));
                     }                      }
                 }                  }
     } elsif ($key=~/^form\.act\_($match_domain)\_($match_username)\_([^\_]+)$/) {      } elsif ($key=~/^form\.act\_($match_domain)\_($match_courseid)\_([^\_]+)$/) {
  # Activate roles for sections with 3 id numbers   # Activate roles for sections with 3 id numbers
  # set start, end times, and the url for the class   # set start, end times, and the url for the class
  my ($one,$two,$three)=($1,$2,$3);   my ($one,$two,$three)=($1,$2,$3);

Removed from v.1.140  
changed lines
  Added in v.1.141


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