Diff for /loncom/interface/loncreateuser.pm between versions 1.52 and 1.53

version 1.52, 2003/04/30 15:49:45 version 1.53, 2003/05/10 23:06:52
Line 254  END Line 254  END
         foreach ('firstname','middlename','lastname','generation') {          foreach ('firstname','middlename','lastname','generation') {
            if (&Apache::lonnet::allowed('mau',$ccdomain)) {             if (&Apache::lonnet::allowed('mau',$ccdomain)) {
               $r->print(<<"END");                            $r->print(<<"END");            
 <td><input type="text" name="c$_" value="$userenv{$_}" size="15"/></td>  <td><input type="text" name="c$_" value="$userenv{$_}" size="15" /></td>
 END  END
            } else {             } else {
                $r->print('<td>'.$userenv{$_}.'</td>');                 $r->print('<td>'.$userenv{$_}.'</td>');
Line 272  END Line 272  END
 <hr />  <hr />
 <h3>Revoke Existing Roles</h3>  <h3>Revoke Existing Roles</h3>
 <table border=2>  <table border=2>
 <tr><th>Revoke</th><th>Role</th><th>Extent</th><th>Start</th><th>End</th>  <tr><th>Revoke</th><th>Delete</th><th>Role</th><th>Extent</th><th>Start</th><th>End</th>
 END  END
    foreach my $area (keys(%rolesdump)) {     foreach my $area (keys(%rolesdump)) {
                next if ($area =~ /^rolesdef/);                 next if ($area =~ /^rolesdef/);
Line 283  END Line 283  END
                    split(/_/,$role);                     split(/_/,$role);
                my $bgcol='ffffff';                 my $bgcol='ffffff';
                my $allowed=0;                 my $allowed=0;
                  my $delallowed=0;
                if ($area =~ /^\/(\w+)\/(\d\w+)/ ) {                 if ($area =~ /^\/(\w+)\/(\d\w+)/ ) {
                    my %coursedata=                     my %coursedata=
                        &Apache::lonnet::coursedescription($1.'_'.$2);                         &Apache::lonnet::coursedescription($1.'_'.$2);
    my $carea;     my $carea;
    if (defined($coursedata{'description'})) {     if (defined($coursedata{'description'})) {
        $carea='Course: '.$coursedata{'description'};         $carea='Course: '.$coursedata{'description'}.
                                 '<br />Domain: '.$1;
    } else {     } else {
        $carea='Unavailable course: '.$area;         $carea='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)) ||
                          (&Apache::lonnet::allowed('c'.$role_code,$ccdomain))) {
                        $allowed=1;                         $allowed=1;
                    }                     }
                      if ((&Apache::lonnet::allowed('dro',$1)) ||
                          (&Apache::lonnet::allowed('dro',$ccdomain))) {
                          $delallowed=1;
                      }
                    # Compute the background color based on $area                     # Compute the background color based on $area
                    $bgcol=$1.'_'.$2;                     $bgcol=$1.'_'.$2;
                    $bgcol=~s/[^8-9b-e]//g;                     $bgcol=~s/[^8-9b-e]//g;
Line 307  END Line 314  END
                } else {                 } else {
                    # Determine if current user is able to revoke privileges                     # Determine if current user is able to revoke privileges
                    if ($area=~ /^\/(\w+)\//) {                     if ($area=~ /^\/(\w+)\//) {
                        if (&Apache::lonnet::allowed('c'.$role_code,$1)) {                         if ((&Apache::lonnet::allowed('c'.$role_code,$1)) ||
                          (&Apache::lonnet::allowed('c'.$role_code,$ccdomain))) {
                            $allowed=1;                             $allowed=1;
                        }                         }
                          if (((&Apache::lonnet::allowed('dro',$1))  ||
                               (&Apache::lonnet::allowed('dro',$ccdomain))) &&
                              ($role_code ne 'dc')) {
                              $delallowed=1;
                          }
                    } else {                     } else {
                        if (&Apache::lonnet::allowed('c'.$role_code,'/')) {                         if (&Apache::lonnet::allowed('c'.$role_code,'/')) {
                            $allowed=1;                             $allowed=1;
Line 333  END Line 346  END
                } else {                 } else {
                    $row.='&nbsp;';                     $row.='&nbsp;';
                }                 }
          $row.='</td><td>';
                  if ($delallowed) {
                      $row.= '<input type="checkbox" name="del:'.$thisrole.'">';
                  } else {
                      $row.='&nbsp;';
                  }
                $row.= '</td><td>'.&Apache::lonnet::plaintext($role_code).                 $row.= '</td><td>'.&Apache::lonnet::plaintext($role_code).
                       '</td><td>'.$area.                        '</td><td>'.$area.
                       '</td><td>'.($role_start_time?localtime($role_start_time)                        '</td><td>'.($role_start_time?localtime($role_start_time)
Line 412  ENDBADAUTH Line 431  ENDBADAUTH
  $authform_other="<p>$authformkrb</p>".   $authform_other="<p>$authformkrb</p>".
                     "<p>$authformint</p><p>$authformfsys</p>";                      "<p>$authformint</p><p>$authformfsys</p>";
     }      }
     $authformcurrent=<<ENDCURRENTAUTH;              $authformcurrent.=' <i>(will override current values)</i><br />';
 <table border='1'>  
 <tr>  
 <td><font color='#ff0000'>* * * WARNING * * *</font></td>  
 <td><font color='#ff0000'>* * * WARNING * * *</font></td>  
 </tr>  
 <tr><td bgcolor='#cbbcbb'>$authformcurrent</td>  
 <td bgcolor='#cbbcbb'>Changing this value will overwrite existing authentication for the user; you should notify the user of this change.</td></tr>  
 </table>  
 ENDCURRENTAUTH  
             if (&Apache::lonnet::allowed('mau',$ENV{'request.role.domain'})) {              if (&Apache::lonnet::allowed('mau',$ENV{'request.role.domain'})) {
  # Current user has login modification privileges   # Current user has login modification privileges
  $r->print(<<ENDOTHERAUTHS);   $r->print(<<ENDOTHERAUTHS);
Line 719  END Line 729  END
  if ($2 eq 'st') {   if ($2 eq 'st') {
     $1=~/^\/(\w+)\/(\w+)/;      $1=~/^\/(\w+)\/(\w+)/;
     my $cid=$1.'_'.$2;      my $cid=$1.'_'.$2;
       $r->print('Drop from classlist: '.
    &Apache::lonnet::critical('put:'.
                                $ENV{'course.'.$cid.'.domain'}.':'.
                        $ENV{'course.'.$cid.'.num'}.':classlist:'.
                            &Apache::lonnet::escape($ENV{'form.ccuname'}.':'.
                                $ENV{'form.ccdomain'}).'='.
                            &Apache::lonnet::escape($now.':'),
                        $ENV{'course.'.$cid.'.home'}).'<br>');
    }
       } 
    } elsif ($_=~/^form\.del/) {
       if ($_=~/^form\.del\:([^\_]+)\_([^\_]+)$/) {
           $r->print('Deleting '.$2.' in '.$1.': '.
                        &Apache::lonnet::assignrole($ENV{'form.ccdomain'},
                        $ENV{'form.ccuname'},$1,$2,$now,0,1).'<br>');
    if ($2 eq 'st') {
       $1=~/^\/(\w+)\/(\w+)/;
       my $cid=$1.'_'.$2;
     $r->print('Drop from classlist: '.      $r->print('Drop from classlist: '.
  &Apache::lonnet::critical('put:'.   &Apache::lonnet::critical('put:'.
                              $ENV{'course.'.$cid.'.domain'}.':'.                               $ENV{'course.'.$cid.'.domain'}.':'.

Removed from v.1.52  
changed lines
  Added in v.1.53


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