Diff for /loncom/interface/loncreateuser.pm between versions 1.64 and 1.65

version 1.64, 2003/07/19 21:44:51 version 1.65, 2003/07/20 00:39:01
Line 755  END Line 755  END
     if ($_=~/^form\.rev\:([^\_]+)\_([^\_\.]+)$/) {      if ($_=~/^form\.rev\:([^\_]+)\_([^\_\.]+)$/) {
 # Revoke standard role  # Revoke standard role
         $r->print('Revoking '.$2.' in '.$1.': <b>'.          $r->print('Revoking '.$2.' in '.$1.': <b>'.
                      &Apache::lonnet::assignrole($ENV{'form.ccdomain'},                       &Apache::lonnet::revokerole($ENV{'form.ccdomain'},
                      $ENV{'form.ccuname'},$1,$2,$now).'</b><br>');                       $ENV{'form.ccuname'},$1,$2).'</b><br>');
  if ($2 eq 'st') {   if ($2 eq 'st') {
     $1=~/^\/(\w+)\/(\w+)/;      $1=~/^\/(\w+)\/(\w+)/;
     my $cid=$1.'_'.$2;      my $cid=$1.'_'.$2;
Line 773  END Line 773  END
     if ($_=~/^form\.rev\:([^\_]+)\_cr\.cr\/(\w+)\/(\w+)\/(\w+)$/) {      if ($_=~/^form\.rev\:([^\_]+)\_cr\.cr\/(\w+)\/(\w+)\/(\w+)$/) {
 # Revoke custom role  # Revoke custom role
  $r->print(   $r->print(
                 'Revoking custom role '.$4.' by '.$3.'\@'.$2.' in '.$1.': <b>'.                  'Revoking custom role '.$4.' by '.$3.'@'.$2.' in '.$1.': <b>'.
   &Apache::lonnet::revokecustomrole($ENV{'form.ccdomain'},
     $ENV{'form.ccuname'},$1,$2,$3,$4).
  '</b><br>');   '</b><br>');
     }      }
  } elsif ($_=~/^form\.del/) {   } elsif ($_=~/^form\.del/) {
Line 795  END Line 797  END
  }   }
     }       } 
  } elsif ($_=~/^form\.act/) {   } elsif ($_=~/^form\.act/) {
     if ($_=~/^form\.act\_([^\_]+)\_([^\_]+)\_([^\_]+)$/) {      if 
   ($_=~/^form\.act\_([^\_]+)\_([^\_]+)\_cr_cr_([^\_]+)_(\w+)_([^\_]+)$/) {
                   # Activate a custom role
    my $url='/'.$1.'/'.$2;
    my $full=$1.'_'.$2.'_cr_cr_'.$3.'_'.$4.'_'.$5;
    if ($ENV{'form.sec_'.$full}) {
       $url.='/'.$ENV{'form.sec_'.$full};
    }
   
    my $start = ( $ENV{'form.start_'.$full} ? 
         $ENV{'form.start_'.$full} : 
         $now );
    my $end   = ( $ENV{'form.end_'.$full} ? 
         $ENV{'form.end_'.$full} :
         0 );
   
       $r->print('Assigning custom role "'.$5.'" by '.$4.'@'.$3.' in '.$url.
                            ($start?', starting '.localtime($start):'').
                            ($end?', ending '.localtime($end):'').': <b>'.
         &Apache::lonnet::assigncustomrole(
    $ENV{'form.ccdomain'},$ENV{'form.ccuname'},$url,$3,$4,$5,$end,$start).
         '</b><br>');
       } elsif ($_=~/^form\.act\_([^\_]+)\_([^\_]+)\_([^\_]+)$/) {
  # 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
   
Line 810  END Line 834  END
     $url.='/'.$ENV{'form.sec_'.$1.'_'.$2.'_'.$3};      $url.='/'.$ENV{'form.sec_'.$1.'_'.$2.'_'.$3};
  }   }
  # Assign the role and report it   # Assign the role and report it
  $r->print('Assigning: '.$3.' in '.$url.   $r->print('Assigning '.$3.' in '.$url.
                          ($start?', starting '.localtime($start):'').                           ($start?', starting '.localtime($start):'').
                          ($end?', ending '.localtime($end):'').': <b>'.                           ($end?', ending '.localtime($end):'').': <b>'.
                           &Apache::lonnet::assignrole(                            &Apache::lonnet::assignrole(
Line 843  END Line 867  END
       0 );        0 );
  my $url='/'.$1.'/';   my $url='/'.$1.'/';
  # Assign the role and report it.   # Assign the role and report it.
  $r->print('Assigning: '.$2.' in '.$url.': '.   $r->print('Assigning '.$2.' in '.$url.': '.
                          ($start?', starting '.localtime($start):'').                           ($start?', starting '.localtime($start):'').
                          ($end?', ending '.localtime($end):'').': <b>'.                           ($end?', ending '.localtime($end):'').': <b>'.
                           &Apache::lonnet::assignrole(                            &Apache::lonnet::assignrole(
Line 1106  ENDTIMEENTRY Line 1130  ENDTIMEENTRY
             }              }
         }          }
         foreach (sort keys %customroles) {          foreach (sort keys %customroles) {
     my $plrole=$_;      if (&Apache::lonnet::allowed('ccr',$thiscourse)) {
     $table .= <<ENDENTRY;   my $plrole=$_;
                   my $customrole=$protectedcourse.'_cr_cr_'.$ENV{'user.domain'}.
       '_'.$ENV{'user.name'}.'_'.$plrole;
    $table .= <<ENDENTRY;
 <tr bgcolor="#$bgcol">  <tr bgcolor="#$bgcol">
 <td><input type="checkbox" name="act_$protectedcourse\_$_"></td>  <td><input type="checkbox" name="act_$customrole"></td>
 <td>$plrole</td>  <td>$plrole</td>
 <td>$area</td>  <td>$area</td>
 <td><input type="text" size="5" name="sec_$protectedcourse\_$_"></td>  <td><input type="text" size="5" name="sec_$customrole"></td>
 <td><input type=hidden name="start_$protectedcourse\_$_" value=''>  <td><input type=hidden name="start_$customrole" value=''>
 <a href=  <a href=
 "javascript:pjump('date_start','Start Date $plrole',document.cu.start_$protectedcourse\_$_.value,'start_$protectedcourse\_$_','cu.pres','dateset')">Set Start Date</a></td>  "javascript:pjump('date_start','Start Date $plrole',document.cu.start_$customrole.value,'start_$customrole','cu.pres','dateset')">Set Start Date</a></td>
 <td><input type=hidden name="end_$protectedcourse\_$_" value=''>  <td><input type=hidden name="end_$customrole" value=''>
 <a href=  <a href=
 "javascript:pjump('date_end','End Date $plrole',document.cu.end_$protectedcourse\_$_.value,'end_$protectedcourse\_$_','cu.pres','dateset')">Set End Date</a></td></tr>  "javascript:pjump('date_end','End Date $plrole',document.cu.end_$customrole.value,'end_$customrole','cu.pres','dateset')">Set End Date</a></td></tr>
 ENDENTRY  ENDENTRY
              }
  }   }
     }      }
     return '' if ($table eq ''); # return nothing if there is nothing       return '' if ($table eq ''); # return nothing if there is nothing 

Removed from v.1.64  
changed lines
  Added in v.1.65


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