Diff for /loncom/interface/loncommon.pm between versions 1.629 and 1.630

version 1.629, 2007/12/23 16:55:25 version 1.630, 2008/01/01 20:27:29
Line 5851  previous, future, or all. Line 5851  previous, future, or all.
 6. reference to results object (hash of hashes).  6. reference to results object (hash of hashes).
 7. reference to optional userdata hash  7. reference to optional userdata hash
 8. reference to optional statushash  8. reference to optional statushash
   9. flag if privileged users (except those set to unhide in
      course settings) should be excluded    
 Keys of top level results hash are roles.  Keys of top level results hash are roles.
 Keys of inner hashes are username:domain, with   Keys of inner hashes are username:domain, with 
 values set to access type.  values set to access type.
Line 5867  of the possibility of multiple values fo Line 5869  of the possibility of multiple values fo
 ###############################################  ###############################################
   
 sub get_course_users {  sub get_course_users {
     my ($cdom,$cnum,$types,$roles,$sections,$users,$userdata,$statushash) = @_;      my ($cdom,$cnum,$types,$roles,$sections,$users,$userdata,$statushash,$hidepriv) = @_;
     my %idx = ();      my %idx = ();
     my %seclists;      my %seclists;
   
Line 5943  sub get_course_users { Line 5945  sub get_course_users {
                               active   => 'Active',                                active   => 'Active',
                               future   => 'Future',                                future   => 'Future',
                             );                              );
           my %nothide;
           if ($hidepriv) {
               my %coursehash=&Apache::lonnet::coursedescription($cdom.'_'.$cnum);
               foreach my $user (split(/\s*\,\s*/,$coursehash{'nothideprivileged'})) {
                   if ($user !~ /:/) {
                       $nothide{join(':',split(/[\@]/,$user))}=1;
                   } else {
                       $nothide{$user} = 1;
                   }
               }
           }
         foreach my $person (sort(keys(%coursepersonnel))) {          foreach my $person (sort(keys(%coursepersonnel))) {
             my $match = 0;              my $match = 0;
             my $secmatch = 0;              my $secmatch = 0;
Line 5976  sub get_course_users { Line 5989  sub get_course_users {
                     $usec = 'none';                      $usec = 'none';
                 }                  }
                 if ($uname ne '' && $udom ne '') {                  if ($uname ne '' && $udom ne '') {
                       if ($hidepriv) {
                           if ((&Apache::lonnet::privileged($uname,$udom)) &&
                               (!$nothide{$uname.':'.$udom})) {
                               next;
                           }
                       }
                     if ($end > 0 && $end < $now) {                      if ($end > 0 && $end < $now) {
                         $status = 'previous';                          $status = 'previous';
                     } elsif ($start > $now) {                      } elsif ($start > $now) {
Line 7756  sub build_recipient_list { Line 7775  sub build_recipient_list {
   
 sub commit_customrole {  sub commit_customrole {
     my ($udom,$uname,$url,$three,$four,$five,$start,$end) = @_;      my ($udom,$uname,$url,$three,$four,$five,$start,$end) = @_;
     my $output = &mt('Assigning custom role').' "'.$five.'" by '.$four.'@'.$three.' in '.$url.      my $output = &mt('Assigning custom role').' "'.$five.'" by '.$four.':'.$three.' in '.$url.
                          ($start?', '.&mt('starting').' '.localtime($start):'').                           ($start?', '.&mt('starting').' '.localtime($start):'').
                          ($end?', ending '.localtime($end):'').': <b>'.                           ($end?', ending '.localtime($end):'').': <b>'.
               &Apache::lonnet::assigncustomrole(                &Apache::lonnet::assigncustomrole(
Line 8116  sub construct_course { Line 8135  sub construct_course {
     }      }
     if ($args->{'notify_dc'}) {      if ($args->{'notify_dc'}) {
         if ($uname ne '') {           if ($uname ne '') { 
             push(@notified,$uname.'@'.$udom);              push(@notified,$uname.':'.$udom);
         }          }
     }      }
     if (@notified > 0) {      if (@notified > 0) {

Removed from v.1.629  
changed lines
  Added in v.1.630


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