Diff for /loncom/interface/loncreateuser.pm between versions 1.406.2.16 and 1.406.2.17

version 1.406.2.16, 2019/07/30 13:55:16 version 1.406.2.17, 2019/08/27 14:45:04
Line 1486  ENDAUTH Line 1486  ENDAUTH
              ($env{'request.role.domain'} eq $ccdomain)) {               ($env{'request.role.domain'} eq $ccdomain)) {
             $user_text{'requestauthor'} = &domainrole_req($ccuname,$ccdomain);              $user_text{'requestauthor'} = &domainrole_req($ccuname,$ccdomain);
         }          }
         $user_text{'auth'} =  &user_authentication($ccuname,$ccdomain,$formname);          $user_text{'auth'} =  &user_authentication($ccuname,$ccdomain,$formname,$crstype,$permission);
         if ((&Apache::lonnet::allowed('mpq',$ccdomain)) ||          if ((&Apache::lonnet::allowed('mpq',$ccdomain)) ||
             (&Apache::lonnet::allowed('mut',$ccdomain)) ||              (&Apache::lonnet::allowed('mut',$ccdomain)) ||
             (&Apache::lonnet::allowed('udp',$ccdomain))) {              (&Apache::lonnet::allowed('udp',$ccdomain))) {
Line 2164  sub new_domain_roles { Line 2164  sub new_domain_roles {
 }  }
   
 sub user_authentication {  sub user_authentication {
     my ($ccuname,$ccdomain,$formname) = @_;      my ($ccuname,$ccdomain,$formname,$crstype,$permission) = @_;
     my $currentauth=&Apache::lonnet::queryauthenticate($ccuname,$ccdomain);      my $currentauth=&Apache::lonnet::queryauthenticate($ccuname,$ccdomain);
     my $outcome;      my $outcome;
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
Line 2236  ENDBADAUTH Line 2236  ENDBADAUTH
             }              }
             $outcome .= &Apache::loncommon::end_data_table();              $outcome .= &Apache::loncommon::end_data_table();
         } else {          } else {
               if (($currentauth =~ /^internal:/) &&
                   (&Apache::lonuserutils::can_change_internalpass($ccuname,$ccdomain,$crstype,$permission))) {
                   $outcome = <<"ENDJS";
   <script type="text/javascript">
   // <![CDATA[
   function togglePwd(form) {
       if (form.newintpwd.length) {
           if (document.getElementById('LC_ownersetpwd')) {
               for (var i=0; i<form.newintpwd.length; i++) {
                   if (form.newintpwd[i].checked) {
                       if (form.newintpwd[i].value == 1) {
                           document.getElementById('LC_ownersetpwd').style.display = 'inline-block';
                       } else {
                           document.getElementById('LC_ownersetpwd').style.display = 'none';
                       }
                   }
               }
           }
       }
   }
   // ]]>
   </script>
   ENDJS
   
                   $outcome .= '<h3>'.$lt{'ld'}.'</h3>'.
                               &Apache::loncommon::start_data_table().
                               &Apache::loncommon::start_data_table_row().
                               '<td>'.&mt('Internally authenticated').'<br />'.&mt("Change user's password?").
                               '<label><input type="radio" name="newintpwd" value="0" checked="checked" onclick="togglePwd(this.form);" />'.
                               &mt('No').'</label>'.('&nbsp;'x2).
                               '<label><input type="radio" name="newintpwd" value="1" onclick="togglePwd(this.form);" />'.&mt('Yes').'</label>'.
                               '<div id="LC_ownersetpwd" style="display:none">'.
                               '&nbsp;&nbsp;'.&mt('Password').' <input type="password" size="15" name="intarg" value="" />'.
                               '<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.intarg.type='."'text'".' } else { this.form.intarg.type='."'password'".' }" />'.&mt('Visible input').'</label></div></td>'.
                               &Apache::loncommon::end_data_table_row().
                               &Apache::loncommon::end_data_table();
               }
             if (&Apache::lonnet::allowed('udp',$ccdomain)) {              if (&Apache::lonnet::allowed('udp',$ccdomain)) {
                 # Current user has rights to view domain preferences for user's domain                  # Current user has rights to view domain preferences for user's domain
                 my $result;                  my $result;
Line 2670  sub get_inststatuses { Line 2707  sub get_inststatuses {
   
 # ================================================================= Phase Three  # ================================================================= Phase Three
 sub update_user_data {  sub update_user_data {
     my ($r,$context,$crstype,$brcrum,$showcredits) = @_;       my ($r,$context,$crstype,$brcrum,$showcredits,$permission) = @_; 
     my $uhome=&Apache::lonnet::homeserver($env{'form.ccuname'},      my $uhome=&Apache::lonnet::homeserver($env{'form.ccuname'},
                                           $env{'form.ccdomain'});                                            $env{'form.ccdomain'});
     # Error messages      # Error messages
Line 2955  sub update_user_data { Line 2992  sub update_user_data {
   ($env{'form.ccuname'},$env{'form.ccdomain'}));    ($env{'form.ccuname'},$env{'form.ccdomain'}));
  } else {   } else {
     # Okay, this is a non-fatal error.      # Okay, this is a non-fatal error.
     $r->print($error.&mt('You do not have the authority to modify this users authentication information.').$end);          $r->print($error.&mt('You do not have privileges to modify the authentication configuration for this user.').$end);    
  }   }
       } elsif (($env{'form.intarg'} ne '') &&
                (&Apache::lonnet::queryauthenticate($env{'form.ccuname'},$env{'form.ccdomain'}) =~ /^internal:/) &&
                (&Apache::lonuserutils::can_change_internalpass($env{'form.ccuname'},$env{'form.ccdomain'},$crstype,$permission))) {
           $r->print('Modifying authentication: '.
                     &Apache::lonnet::modifyuserauth(
                     $env{'form.ccdomain'},$env{'form.ccuname'},
                     'internal',$env{'form.intarg'}));
     }      }
     $r->rflush(); # Finish display of header before time consuming actions start      $r->rflush(); # Finish display of header before time consuming actions start
     &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state);      &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state);
Line 4862  sub handler { Line 4906  sub handler {
                 &print_useraccesslogs_display($r,$ccuname,$ccdomain,$permission,$brcrum);                  &print_useraccesslogs_display($r,$ccuname,$ccdomain,$permission,$brcrum);
             }              }
         } elsif ($env{'form.phase'} eq 'update_user_data') {          } elsif ($env{'form.phase'} eq 'update_user_data') {
             &update_user_data($r,$context,$crstype,$brcrum,$showcredits);              &update_user_data($r,$context,$crstype,$brcrum,$showcredits,$permission);
         } else {          } else {
             &print_username_entry_form($r,$context,undef,$srch,undef,$crstype,              &print_username_entry_form($r,$context,undef,$srch,undef,$crstype,
                                        $brcrum,$permission);                                         $brcrum,$permission);

Removed from v.1.406.2.16  
changed lines
  Added in v.1.406.2.17


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