Diff for /loncom/interface/lonuserutils.pm between versions 1.136 and 1.136.6.2

version 1.136, 2011/08/05 14:46:58 version 1.136.6.2, 2012/02/08 19:35:20
Line 342  sub print_upload_manager_header { Line 342  sub print_upload_manager_header {
              ."</p>\n");               ."</p>\n");
     $r->print('<div class="LC_left_float"><h3>'.      $r->print('<div class="LC_left_float"><h3>'.
               &mt('Identify fields in uploaded list')."</h3>\n");                &mt('Identify fields in uploaded list')."</h3>\n");
     $r->print(&mt('Enter as many fields as you can.<br /> The system will inform you and bring you back to this page, <br /> if the data selected are insufficient to add users.')."<br />\n");      $r->print(&mt('Enter as many fields as you can.').'<br />'.
                &mt('The system will inform you and bring you back to this page, [_1]if the data selected are insufficient to add users.','<br />')."<br />\n");
     $r->print(&hidden_input('action','upload').      $r->print(&hidden_input('action','upload').
               &hidden_input('state','got_file').                &hidden_input('state','got_file').
               &hidden_input('associate','').                &hidden_input('associate','').
Line 2321  END Line 2322  END
                        'type'       => "enroll type/action",                         'type'       => "enroll type/action",
                        'email'      => "e-mail address",                         'email'      => "e-mail address",
                        'photo'      => "photo",                         'photo'      => "photo",
                          'lastlogin'  => "last login"
                        'extent'     => "extent",                         'extent'     => "extent",
                        'pr'         => "Proceed",                         'pr'         => "Proceed",
                        'ca'         => "check all",                         'ca'         => "check all",
Line 2369  END Line 2371  END
             push(@cols,'groups');              push(@cols,'groups');
         }          }
         push(@cols,'email');          push(@cols,'email');
           if ($context eq 'course') {
               push(@cols,'lastlogin');
           }
     }      }
   
     my $rolefilter = $env{'form.showrole'};      my $rolefilter = $env{'form.showrole'};
Line 2593  END Line 2598  END
                                                 Future  => 'Future',                                                  Future  => 'Future',
                                                 Expired => 'Expired',                                                  Expired => 'Expired',
                                                );                                                 );
       # If this is for a single course get last course "log-in".
       my %crslogins;
       if ($context eq 'course') {
           %crslogins=&Apache::lonnet::dump('nohist_crslastlogin',$cdom,$cnum);
       }
     # Get groups, role, permanent e-mail so we can sort on them if      # Get groups, role, permanent e-mail so we can sort on them if
     # necessary.      # necessary.
     foreach my $user (keys(%{$userlist})) {      foreach my $user (keys(%{$userlist})) {
Line 2741  END Line 2751  END
                 $in{'end'} = &Apache::lonlocal::locallocaltime($in{'end'});                  $in{'end'} = &Apache::lonlocal::locallocaltime($in{'end'});
             }              }
         }          }
           if ($context eq 'course') {
               my $lastlogin = $crslogins{$in{'username'}.':'.$in{'domain'}.':'.$in{'section'}.':'.$role};
               if ($lastlogin ne '') {
                   $in{'lastlogin'} = &Apache::lonlocal::locallocaltime($lastlogin);
               }
           }
         if ($mode eq 'view' || $mode eq 'html' || $mode eq 'autoenroll' || $mode eq 'pickauthor') {          if ($mode eq 'view' || $mode eq 'html' || $mode eq 'autoenroll' || $mode eq 'pickauthor') {
             $r->print(&Apache::loncommon::start_data_table_row());              $r->print(&Apache::loncommon::start_data_table_row());
             my $checkval;              my $checkval;
Line 4165  sub upfile_drop_add { Line 4181  sub upfile_drop_add {
                         }                          }
                         $checkid = 1;                          $checkid = 1;
                         $newuser = 1;                          $newuser = 1;
                         my $user = $username.':'.$newuserdom;                          if ($username =~/^[^\@]+\@[^\@]+$/) {
                               if ($email eq '') {
                                   $email = $username;
                               }
                               my $lc_email;
                               if ($username eq $email) {
                                   $lc_email = lc($email);
                               }
                               my $lc_username = lc($username);
                               if ($lc_username ne $username) {
                                   if ($username eq $email) {
                                       $email = $lc_username;
                                   }
                                   $username = $lc_username;
                                   $uhome=&Apache::lonnet::homeserver($username,$userdomain);
                                   if ($uhome ne 'no_host') {
                                       $newuser = 0;
                                   }
                               }
                           }
                       }
                       my $user = $username.':'.$newuserdom;
                       if ($newuser) {
                         my $checkhash;                          my $checkhash;
                         my $checks = { 'username' => 1 };                          my $checks = { 'username' => 1 };
                         $checkhash->{$username.':'.$newuserdom} = { 'newuser' => 1, };                          $checkhash->{$user} = { 'newuser' => 1, };
                         &Apache::loncommon::user_rule_check($checkhash,$checks,                          &Apache::loncommon::user_rule_check($checkhash,$checks,
                             \%alerts,\%rulematch,\%inst_results,\%curr_rules,                              \%alerts,\%rulematch,\%inst_results,\%curr_rules,
                             \%got_rules);                              \%got_rules);
Line 4190  sub upfile_drop_add { Line 4228  sub upfile_drop_add {
                         }                          }
                         unless ($cancreate{$usertype}) {                          unless ($cancreate{$usertype}) {
                             my $showtype = $longtypes{$usertype};                              my $showtype = $longtypes{$usertype};
                             $r->print('<br />'.                              if ($usertype eq 'unofficial') {
                                       &mt('[_1]: The user does not exist, and you are not permitted to create users of type: [_2].','<b>'.$username.'</b>',$showtype));                                  $r->print('<br />'.
                                             &mt("[_1]: The user does not exist, and the new user's username must be an e-mail address.",'<b>'.$username.'</b>'));
                               } else {
                                   $r->print('<br />'.
                                             &mt("[_1]: The user does not exist, and you are not permitted to create users of type: [_2].",'<b>'.$username.'</b>',$showtype));
                               }
                             next;                              next;
                         }                          }
                     } else {                      } else {

Removed from v.1.136  
changed lines
  Added in v.1.136.6.2


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