Diff for /loncom/interface/domainprefs.pm between versions 1.76.2.3 and 1.76.2.6

version 1.76.2.3, 2008/12/18 17:06:00 version 1.76.2.6, 2008/12/26 22:27:24
Line 39  use Apache::lonlocal; Line 39  use Apache::lonlocal;
 use Apache::lonmsg();  use Apache::lonmsg();
 use LONCAPA qw(:DEFAULT :match);  use LONCAPA qw(:DEFAULT :match);
 use LONCAPA::Enrollment;  use LONCAPA::Enrollment;
 use LONCAPA::loncgi();  use LONCAPA::lonauthcgi();
 use File::Copy;  use File::Copy;
 use Locale::Language;  use Locale::Language;
 use DateTime::TimeZone;  use DateTime::TimeZone;
Line 1329  sub print_quotas { Line 1329  sub print_quotas {
                       '" value="_LC_adv" '.$checked.'/>'.$titles{$item}.                        '" value="_LC_adv" '.$checked.'/>'.$titles{$item}.
                       '</label></span>&nbsp; ';                        '</label></span>&nbsp; ';
     }      }
     $datatable .= '('.&mt('overrides affiliation').')</td></tr>';      $datatable .= '<span class="LC_nobreak">('.&mt('overrides affiliation').
                     ')</span></td></tr>';
     $$rowtotal += $typecount;      $$rowtotal += $typecount;
     return $datatable;      return $datatable;
 }  }
Line 2372  sub print_serverstatuses { Line 2373  sub print_serverstatuses {
             }              }
         }          }
     }      }
     my $titles= &LONCAPA::loncgi::serverstatus_titles();      my $titles= &LONCAPA::lonauthcgi::serverstatus_titles();
     my $rownum = 0;      my $rownum = 0;
     my $css_class;      my $css_class;
     foreach my $type (@pages) {      foreach my $type (@pages) {
Line 3618  sub modify_quotas { Line 3619  sub modify_quotas {
                         &Apache::lonnet::usertools_access($env{'user.name'},                          &Apache::lonnet::usertools_access($env{'user.name'},
                                                           $env{'user.domain'},                                                            $env{'user.domain'},
                                                           $item,'reload');                                                            $item,'reload');
                     if ($env{'environment.tools.'.$item} ne '') {                      if ($env{'environment.availabletools.'.$item} ne $newacc) {
                         if ($env{'environment.availabletools.'.$item} ne $newacc) {  
                             $newenv{'environment.availabletools.'.$item} = $newacc;                              $newenv{'environment.availabletools.'.$item} = $newacc;
                         }  
                     }                      }
                     $resulttext .= '<li>'.$titles{$item}.'<ul>';                      $resulttext .= '<li>'.$titles{$item}.'<ul>';
                     foreach my $type (@{$types},'default','_LC_adv') {                      foreach my $type (@{$types},'default','_LC_adv') {
Line 4978  sub modify_serverstatuses { Line 4977  sub modify_serverstatuses {
     my %serverstatushash =  (      my %serverstatushash =  (
                                 serverstatuses => \%newserverstatus,                                  serverstatuses => \%newserverstatus,
                             );                              );
     my $putresult = &Apache::lonnet::put_dom('configuration',\%serverstatushash,  
                                              $dom);  
     my %changes;      my %changes;
     foreach my $type (@pages) {      foreach my $type (@pages) {
         if (ref($currserverstatus{$type}) eq 'HASH') {          foreach my $setting ('namedusers','machines') {
             my @currnamed = split(/,/,$currserverstatus{$type}{'namedusers'});              my (@current,@new);
             my @newusers = split(/,/,$newserverstatus{$type}{'namedusers'});              if (ref($currserverstatus{$type}) eq 'HASH') {
             foreach my $item (@currnamed) {                  if ($currserverstatus{$type}{$setting} ne '') {
                 if (!grep(/^\Q$item\E$/,@newusers)) {                      @current = split(/,/,$currserverstatus{$type}{$setting});
                     $changes{$type}{'namedusers'} = 1;  
                     last;  
                 }  
             }  
             foreach my $item (@newusers) {  
                 if (!grep(/^\Q$item\E$/,@currnamed)) {  
                     $changes{$type}{'namedusers'} = 1;  
                     last;  
                 }                  }
             }              }
             my @currmachines = split(/,/,$currserverstatus{$type}{'machines'});              if ($newserverstatus{$type}{$setting} ne '') {
             my @newmachines = split(/,/,$newserverstatus{$type}{'machines'});                  @new = split(/,/,$newserverstatus{$type}{$setting});
             foreach my $item (@currmachines) {              }
                 if (!grep(/^\Q$item\E$/,@newmachines)) {              if (@current > 0) {
                     $changes{$type}{'machines'} = 1;                  if (@new > 0) {
                     last;                      foreach my $item (@current) {
                 }                          if (!grep(/^\Q$item\E$/,@new)) {
             }                              $changes{$type}{$setting} = 1;
             foreach my $item (@newmachines) {                              last;
                 if (!grep(/^\Q$item\E$/,@currmachines)) {                          }
                     $changes{$type}{'machines'} = 1;                      }
                     last;                      foreach my $item (@new) {
                           if (!grep(/^\Q$item\E$/,@current)) {
                               $changes{$type}{$setting} = 1;
                               last;
                           }
                       }
                   } else {
                       $changes{$type}{$setting} = 1;
                 }                  }
               } elsif (@new > 0) {
                   $changes{$type}{$setting} = 1;
             }              }
   
         }          }
     }      }
     if (keys(%changes) > 0) {      if (keys(%changes) > 0) {
         my $titles= &LONCAPA::loncgi::serverstatus_titles();          my $titles= &LONCAPA::lonauthcgi::serverstatus_titles();
         my $putresult = &Apache::lonnet::put_dom('configuration',          my $putresult = &Apache::lonnet::put_dom('configuration',
                                                  \%serverstatushash,$dom);                                                   \%serverstatushash,$dom);
         if ($putresult eq 'ok') {          if ($putresult eq 'ok') {
             $resulttext .= &mt('Changes made:').'<ul>';              $resulttext .= &mt('Changes made:').'<ul>';
             foreach my $type (@pages) {              foreach my $type (@pages) {
                 if (defined($changes{$type})) {                  if (ref($changes{$type}) eq 'HASH') {
                     $resulttext .= '<li>'.$titles->{$type}.'<ul>';                      $resulttext .= '<li>'.$titles->{$type}.'<ul>';
                     if (defined($changes{$type}{'namedusers'})) {                      if ($changes{$type}{'namedusers'}) {
                         if ($newserverstatus{$type}{'namedusers'} eq '') {                          if ($newserverstatus{$type}{'namedusers'} eq '') {
                             $resulttext .= '<li>'.&mt("Access terminated for all specific (named) users").'</li>'."\n";                              $resulttext .= '<li>'.&mt("Access terminated for all specific (named) users").'</li>'."\n";
                         } else {                          } else {
                             $resulttext .= '<li>'.&mt("Access available for the following specified users: ").$newserverstatus{$type}{'namedusers'}.'</li>'."\n";                              $resulttext .= '<li>'.&mt("Access available for the following specified users: ").$newserverstatus{$type}{'namedusers'}.'</li>'."\n";
                         }                          }
                     } elsif (defined($changes{$type}{'machines'})) {                      }
                       if ($changes{$type}{'machines'}) {
                         if ($newserverstatus{$type}{'machines'} eq '') {                          if ($newserverstatus{$type}{'machines'} eq '') {
                             $resulttext .= '<li>'.&mt("Access terminated for all specific IP addresses").'</li>'."\n";                              $resulttext .= '<li>'.&mt("Access terminated for all specific IP addresses").'</li>'."\n";
                         } else {                          } else {

Removed from v.1.76.2.3  
changed lines
  Added in v.1.76.2.6


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