Diff for /loncom/interface/loncreateuser.pm between versions 1.81 and 1.86

version 1.81, 2004/04/15 22:35:51 version 1.86, 2004/08/24 23:50:15
Line 123  sub print_username_entry_form { Line 123  sub print_username_entry_form {
     my $defdom=$ENV{'request.role.domain'};      my $defdom=$ENV{'request.role.domain'};
     my @domains = &Apache::loncommon::get_domains();      my @domains = &Apache::loncommon::get_domains();
     my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain');      my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain');
     my $bodytag =&Apache::loncommon::bodytag(      my $bodytag =&Apache::loncommon::bodytag('Create Users, Change User Privileges').&Apache::loncommon::help_open_menu('',undef,undef,'',282,'Instructor Interface');
                                   'Create Users, Change User Privileges').  
   &Apache::loncommon::help_open_faq(282).  
   &Apache::loncommon::help_open_bug('Instructor Interface');  
     my $selscript=&Apache::loncommon::studentbrowser_javascript();      my $selscript=&Apache::loncommon::studentbrowser_javascript();
     my $sellink=&Apache::loncommon::selectstudent_link      my $sellink=&Apache::loncommon::selectstudent_link
                                         ('crtuser','ccuname','ccdomain');                                          ('crtuser','ccuname','ccdomain');
Line 177  sub print_user_modification_page { Line 174  sub print_user_modification_page {
     my $ccuname=$ENV{'form.ccuname'};      my $ccuname=$ENV{'form.ccuname'};
     my $ccdomain=$ENV{'form.ccdomain'};      my $ccdomain=$ENV{'form.ccdomain'};
   
     $ccuname=~s/\W//gs;      $ccuname=~s/[\W|_]//gs;
     $ccdomain=~s/\W//gs;      $ccdomain=~s/[\W|_]//gs;
   
     unless (($ccuname) && ($ccdomain)) {      unless (($ccuname) && ($ccdomain)) {
  &print_username_entry_form($r);   &print_username_entry_form($r);
Line 392  END Line 389  END
        $sortkey.="\0".$coursedata{'description'};         $sortkey.="\0".$coursedata{'description'};
    } else {     } else {
        $carea=&mt('Unavailable course').': '.$area;         $carea=&mt('Unavailable course').': '.$area;
        $sortkey.="\0".&mt('Unavailable course');         $sortkey.="\0".&mt('Unavailable course').': '.$area;
    }     }
                    $inccourses{$1.'_'.$2}=1;                     $inccourses{$1.'_'.$2}=1;
                    if ((&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) ||                     if ((&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) ||
Line 986  END Line 983  END
  }   }
     }       } 
  } elsif ($_=~/^form\.act/) {   } elsif ($_=~/^form\.act/) {
     if       if ($_=~/^form\.act\_([^\_]+)\_([^\_]+)\_cr_cr_([^\_]+)_(\w+)_([^\_]+)$/) {
 ($_=~/^form\.act\_([^\_]+)\_([^\_]+)\_cr_cr_([^\_]+)_(\w+)_([^\_]+)$/) {  
                 # Activate a custom role                  # Activate a custom role
  my $url='/'.$1.'/'.$2;   my ($one,$two,$three,$four,$five)=($1,$2,$3,$4,$5);
  my $full=$1.'_'.$2.'_cr_cr_'.$3.'_'.$4.'_'.$5;   my $url='/'.$one.'/'.$two;
    my $full=$one.'_'.$two.'_cr_cr_'.$three.'_'.$four.'_'.$five;
    $ENV{'form.sec_'.$full}=~s/\W//g;
  if ($ENV{'form.sec_'.$full}) {   if ($ENV{'form.sec_'.$full}) {
     $url.='/'.$ENV{'form.sec_'.$full};      $url.='/'.$ENV{'form.sec_'.$full};
  }   }
Line 1002  END Line 1000  END
       $ENV{'form.end_'.$full} :        $ENV{'form.end_'.$full} :
       0 );        0 );
   
     $r->print(&mt('Assigning custom role').' "'.$5.'" by '.$4.'@'.$3.' in '.$url.      $r->print(&mt('Assigning custom role').' "'.$five.'" by '.$four.'@'.$three.' in '.$url.
                          ($start?', '.&mt('starting').' '.localtime($start):'').                           ($start?', '.&mt('starting').' '.localtime($start):'').
                          ($end?', ending '.localtime($end):'').': <b>'.                           ($end?', ending '.localtime($end):'').': <b>'.
       &Apache::lonnet::assigncustomrole(        &Apache::lonnet::assigncustomrole(
  $ENV{'form.ccdomain'},$ENV{'form.ccuname'},$url,$3,$4,$5,$end,$start).   $ENV{'form.ccdomain'},$ENV{'form.ccuname'},$url,$three,$four,$five,$end,$start).
       '</b><br>');        '</b><br>');
     } elsif ($_=~/^form\.act\_([^\_]+)\_([^\_]+)\_([^\_]+)$/) {      } 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
    my ($one,$two,$three)=($1,$2,$3);
  my $start = ( $ENV{'form.start_'.$1.'_'.$2.'_'.$3} ?    my $start = ( $ENV{'form.start_'.$one.'_'.$two.'_'.$three} ? 
       $ENV{'form.start_'.$1.'_'.$2.'_'.$3} :         $ENV{'form.start_'.$one.'_'.$two.'_'.$three} : 
       $now );        $now );
  my $end   = ( $ENV{'form.end_'.$1.'_'.$2.'_'.$3} ?    my $end   = ( $ENV{'form.end_'.$one.'_'.$two.'_'.$three} ? 
       $ENV{'form.end_'.$1.'_'.$2.'_'.$3} :        $ENV{'form.end_'.$one.'_'.$two.'_'.$three} :
       0 );        0 );
  my $url='/'.$1.'/'.$2;   my $url='/'.$one.'/'.$two;
  if ($ENV{'form.sec_'.$1.'_'.$2.'_'.$3}) {   $ENV{'form.sec_'.$one.'_'.$two.'_'.$three}=~s/\W//g;
     $url.='/'.$ENV{'form.sec_'.$1.'_'.$2.'_'.$3};   if ($ENV{'form.sec_'.$one.'_'.$two.'_'.$three}) {
       $url.='/'.$ENV{'form.sec_'.$one.'_'.$two.'_'.$three};
  }   }
  # Assign the role and report it   # Assign the role and report it
  $r->print(&mt('Assigning').' '.$3.' in '.$url.   $r->print(&mt('Assigning').' '.$three.' in '.$url.
                          ($start?', '.&mt('starting').' '.localtime($start):'').                           ($start?', '.&mt('starting').' '.localtime($start):'').
                          ($end?', '.&mt('ending').' '.localtime($end):'').': <b>'.                           ($end?', '.&mt('ending').' '.localtime($end):'').': <b>'.
                           &Apache::lonnet::assignrole(                            &Apache::lonnet::assignrole(
                               $ENV{'form.ccdomain'},$ENV{'form.ccuname'},                                $ENV{'form.ccdomain'},$ENV{'form.ccuname'},
                               $url,$3,$end,$start).                                $url,$three,$end,$start).
   '</b><br>');    '</b><br>');
  # Handle students differently   # Handle students differently
  if ($3 eq 'st') {   if ($three eq 'st') {
     $url=~/^\/(\w+)\/(\w+)/;      $url=~/^\/(\w+)\/(\w+)/;
     my $cid=$1.'_'.$2;      my $cid=$one.'_'.$two;
     $r->print(&mt('Add to classlist').': <b>'.      $r->print(&mt('Add to classlist').': <b>'.
       &Apache::lonnet::critical(        &Apache::lonnet::critical(
   'put:'.$ENV{'course.'.$cid.'.domain'}.':'.    'put:'.$ENV{'course.'.$cid.'.domain'}.':'.
Line 1297  sub course_level_table { Line 1296  sub course_level_table {
  my $bgcol=$thiscourse;   my $bgcol=$thiscourse;
  $bgcol=~s/[^7-9a-e]//g;   $bgcol=~s/[^7-9a-e]//g;
  $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6);   $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6);
    my ($domain)=split(/\//,$thiscourse);
  foreach  ('st','ta','ep','ad','in','cc') {   foreach  ('st','ta','ep','ad','in','cc') {
     if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) {      if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) {
  my $plrole=&Apache::lonnet::plaintext($_);   my $plrole=&Apache::lonnet::plaintext($_);
Line 1304  sub course_level_table { Line 1304  sub course_level_table {
 <tr bgcolor="#$bgcol">  <tr bgcolor="#$bgcol">
 <td><input type="checkbox" name="act_$protectedcourse\_$_"></td>  <td><input type="checkbox" name="act_$protectedcourse\_$_"></td>
 <td>$plrole</td>  <td>$plrole</td>
 <td>$area</td>  <td>$area<br />Domain: $domain</td>
 ENDEXTENT  ENDEXTENT
         if ($_ ne 'cc') {          if ($_ ne 'cc') {
     $table .= <<ENDSECTION;      $table .= <<ENDSECTION;

Removed from v.1.81  
changed lines
  Added in v.1.86


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