Diff for /loncom/interface/loncreateuser.pm between versions 1.256 and 1.257

version 1.256, 2008/07/16 12:06:28 version 1.257, 2008/07/17 20:05:14
Line 1397  sub modify_login_block { Line 1397  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) = @_;
     my ($output,$showforceid,%userenv,%canmodify,@inststatuses);      my ($output,$showforceid,%userenv,%canmodify);
     my @userinfo = ('firstname','middlename','lastname','generation',      my @userinfo = ('firstname','middlename','lastname','generation',
                     'permanentemail','id');                      'permanentemail','id');
     my $rowcount = 0;      my $rowcount = 0;
     my $editable = 0;      my $editable = 0;
     if ($context eq 'selfcreate') {  
         if (ref($inst_results) eq 'HASH') {  
             @inststatuses = &get_inststatuses($inst_results);  
             if (@inststatuses == 0) {  
                 @inststatuses = ('default');  
             }  
             $rolesarray = \@inststatuses;  
         }  
     }  
     if (!$newuser) {      if (!$newuser) {
         # Get the users information          # Get the users information
         %userenv = &Apache::lonnet::get('environment',          %userenv = &Apache::lonnet::get('environment',
                    ['firstname','middlename','lastname','generation',                     ['firstname','middlename','lastname','generation',
                     'permanentemail','id'],$ccdomain,$ccuname);                      'permanentemail','id'],$ccdomain,$ccuname);
     }      }
     if ((!$newuser) || ($context eq 'selfcreate')) {      if (!$newuser) {
         %canmodify =          %canmodify =
             &Apache::lonuserutils::can_modify_userinfo($context,$ccdomain,              &Apache::lonuserutils::can_modify_userinfo($context,$ccdomain,
                                                        \@userinfo,$rolesarray);                                                         \@userinfo,$rolesarray);
       } elsif ($context eq 'selfcreate') {
           %canmodify = &selfcreate_canmodify($context,$ccdomain,\@userinfo,
                                              $inst_results,$rolesarray);
     }      }
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
                 'pd'             => "Personal Data",                  'pd'             => "Personal Data",
Line 1506  sub personal_data_display { Line 1500  sub personal_data_display {
     }      }
 }  }
   
   sub selfcreate_canmodify {
       my ($context,$dom,$userinfo,$inst_results,$rolesarray) = @_;
       if (ref($inst_results) eq 'HASH') {
           my @inststatuses = &get_inststatuses($inst_results);
           if (@inststatuses == 0) {
               @inststatuses = ('default');
           }
           $rolesarray = \@inststatuses;
       }
       my %canmodify =
           &Apache::lonuserutils::can_modify_userinfo($context,$dom,$userinfo,
                                                      $rolesarray);
       return %canmodify;
   }
   
 sub get_inststatuses {  sub get_inststatuses {
     my ($insthashref) = @_;      my ($insthashref) = @_;
     my @inststatuses = ();      my @inststatuses = ();
Line 3738  sub selfenroll_inst_types { Line 3747  sub selfenroll_inst_types {
                 $output .= '</tr><tr>';                  $output .= '</tr><tr>';
             }              }
             if (defined($usertypes->{$type})) {              if (defined($usertypes->{$type})) {
                   my $esc_type = &escape($type);
                 $output .= '<td><span class="LC_nobreak"><label><input type = "checkbox" value="'.                  $output .= '<td><span class="LC_nobreak"><label><input type = "checkbox" value="'.
                            $type.'" ';                             $esc_type.'" ';
                 if (ref($currinsttypes) eq 'ARRAY') {                  if (ref($currinsttypes) eq 'ARRAY') {
                     if (@{$currinsttypes} > 0) {                      if (@{$currinsttypes} > 0) {
                         if (grep(/^any$/,@{$currinsttypes})) {                          if (grep(/^any$/,@{$currinsttypes})) {
                             $output .= 'checked="checked"';                              $output .= 'checked="checked"';
                         } elsif (grep(/^\Q$type\E$/,@{$currinsttypes})) {                          } elsif (grep(/^\Q$esc_type\E$/,@{$currinsttypes})) {
                             $output .= 'checked="checked"';                              $output .= 'checked="checked"';
                         }                          }
                     } else {                      } else {
Line 4734  sub update_selfenroll_config { Line 4744  sub update_selfenroll_config {
                             my $othervalue = 'any';                              my $othervalue = 'any';
                             if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) {                              if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) {
                                 if (@{$types} > 0) {                                  if (@{$types} > 0) {
                                       my @esc_types = map { &escape($_); } @{$types};
                                     $othervalue = 'other';                                      $othervalue = 'other';
                                     $typestr = join(',',(@{$types},$othervalue));                                      $typestr = join(',',($othervalue,@esc_types));
                                 }                                  }
                                 $typestr = $othervalue;                                  $typestr = $othervalue;
                             } else {                              } else {

Removed from v.1.256  
changed lines
  Added in v.1.257


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