Diff for /loncom/interface/loncreateuser.pm between versions 1.442 and 1.443

version 1.442, 2017/07/26 19:45:45 version 1.443, 2017/08/03 16:22:09
Line 2352  sub modify_login_block { Line 2352  sub modify_login_block {
   
 sub personal_data_display {  sub personal_data_display {
     my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray,      my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray,
         $now,$captchaform,$emailusername,$usertype,$usernameset,$condition) = @_;          $now,$captchaform,$emailusername,$usertype,$usernameset,$condition,$excluded) = @_;
     my ($output,%userenv,%canmodify,%canmodify_status);      my ($output,%userenv,%canmodify,%canmodify_status);
     my @userinfo = ('firstname','middlename','lastname','generation',      my @userinfo = ('firstname','middlename','lastname','generation',
                     'permanentemail','id');                      'permanentemail','id');
Line 2428  sub personal_data_display { Line 2428  sub personal_data_display {
     $output = '<h3>'.$lt{'pd'}.'</h3>'.      $output = '<h3>'.$lt{'pd'}.'</h3>'.
               &Apache::lonhtmlcommon::start_pick_box();                &Apache::lonhtmlcommon::start_pick_box();
     if (($context eq 'selfcreate') && ($newuser eq 'email')) {      if (($context eq 'selfcreate') && ($newuser eq 'email')) {
           my $size = 25;
         if ($condition) {          if ($condition) {
             if ($condition =~ /[-\w]+\.[-\w]+$/) {              if ($condition =~ /^\@[^\@]+$/) {
                 $condition = '@'.$condition;                  $size = 10;
             } else {              } else {
                 undef($condition);                  undef($condition);
             }              }
           } 
           if ($excluded) {
               unless ($excluded =~ /^\@[^\@]+$/) {
                   undef($condition);
               }
         }          }
         $output .= &Apache::lonhtmlcommon::row_title($lt{'email'}.'<b>*</b>',undef,          $output .= &Apache::lonhtmlcommon::row_title($lt{'email'}.'<b>*</b>',undef,
                                                      'LC_oddrow_value')."\n".                                                       'LC_oddrow_value')."\n".
                    '<input type="text" name="uname" size="25" value="'.$condition.'" autocomplete="off" />';                     '<input type="text" name="uname" size="'.$size.'" value="" autocomplete="off" />';
           if ($condition) {
               $output .= $condition;
           } elsif ($excluded) {
               $output .= '<br /><span style="font-size: smaller">'.&mt('You must use an e-mail address that does not end with [_1]',
                                                                        $excluded).'</span>';
           }
           if ($usernameset eq 'first') {
               $output .= '<br /><span style="font-size: smaller">';
               if ($condition) {
                   $output .= &mt('Your username in LON-CAPA will be the part of your e-mail address before [_1]',
                                         $condition);
               } else {
                   $output .= &mt('Your username in LON-CAPA will be the part of your e-mail address before the @');
               }
               $output .= '</span>';
           }
         $rowcount ++;          $rowcount ++;
         $output .= &Apache::lonhtmlcommon::row_closure(1);          $output .= &Apache::lonhtmlcommon::row_closure(1);
         my $upassone = '<input type="password" name="upass'.$now.'" size="20" autocomplete="off" />';          my $upassone = '<input type="password" name="upass'.$now.'" size="20" autocomplete="off" />';
Line 2452  sub personal_data_display { Line 2474  sub personal_data_display {
                                                      'LC_oddrow_value')."\n".                                                       'LC_oddrow_value')."\n".
                    $upasstwo.                     $upasstwo.
                    &Apache::lonhtmlcommon::row_closure()."\n";                     &Apache::lonhtmlcommon::row_closure()."\n";
         if ($usernameset) {          if ($usernameset eq 'free') {
             my $onclick = "toggleDisplay(this,'selfcreateusername');";               my $onclick = "toggleUsernameDisp(this,'selfcreateusername');"; 
             $output .= &Apache::lonhtmlcommon::row_title($lt{'username'},undef,'LC_oddrow_value')."\n".              $output .= &Apache::lonhtmlcommon::row_title($lt{'username'},undef,'LC_oddrow_value')."\n".
                        &mt('Use e-mail address: ').                         &mt('Use e-mail address: ').
                        '<label><input type="radio" name="emailused" value="1" checked="checked" onclick="'.$onclick.'" />'.&mt('Yes').'</label>'."\n".                         '<label><input type="radio" name="emailused" value="1" checked="checked" onclick="'.$onclick.'" />'.&mt('Yes').'</label>'."\n".
Line 4943  sub handler { Line 4965  sub handler {
                             my ($showstatus,$showemail,$pickstart);                              my ($showstatus,$showemail,$pickstart);
                             my $numextras = 0;                              my $numextras = 0;
                             my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);                              my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
                             if (ref($usertypes) eq 'HASH') {                              if ((ref($types) eq 'ARRAY') && (@{$types} > 0)) {
                                 if ($usertypes->{$usertype}) {                                  if (ref($usertypes) eq 'HASH') {
                                     $showstatus = $usertypes->{$usertype};                                      if ($usertypes->{$usertype}) {
                                 } else {                                          $showstatus = $usertypes->{$usertype};
                                     $showstatus = $othertitle;                                      } else {
                                           $showstatus = $othertitle;
                                       }
                                       if ($showstatus) {
                                           $numextras ++;
                                       }
                                 }                                  }
                                 $numextras ++;  
                             }                              }
                             if (($info{$uname}{'email'} ne '') && ($info{$uname}{'email'} ne $uname)) {                              if (($info{$uname}{'email'} ne '') && ($info{$uname}{'email'} ne $uname)) {
                                 $showemail = $info{$uname}{'email'};                                  $showemail = $info{$uname}{'email'};

Removed from v.1.442  
changed lines
  Added in v.1.443


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