Diff for /loncom/interface/domainprefs.pm between versions 1.78 and 1.85

version 1.78, 2008/12/17 21:50:29 version 1.85, 2009/01/27 15:59:30
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 1317  sub print_quotas { Line 1317  sub print_quotas {
                   '<td class="LC_left_item" colspan="2"><br />';                    '<td class="LC_left_item" colspan="2"><br />';
     foreach my $item (@usertools) {      foreach my $item (@usertools) {
         my $checked = 'checked="checked" ';          my $checked = 'checked="checked" ';
         if (ref($settings->{$item}) eq 'HASH') {          if (ref($settings) eq 'HASH') {
             if ($settings->{$item}->{'_LC_adv'} == 0) {              if (ref($settings->{$item}) eq 'HASH') {
                 $checked = '';                  if ($settings->{$item}->{'_LC_adv'} == 0) {
                       $checked = '';
                   }
             }              }
         }          }
         $datatable .= '<span class="LC_nobreak"><label>'.          $datatable .= '<span class="LC_nobreak"><label>'.
Line 1328  sub print_quotas { Line 1330  sub print_quotas {
                       '</label></span>&nbsp; ';                        '</label></span>&nbsp; ';
     }      }
     $datatable .= '<span class="LC_nobreak">('.&mt('overrides affiliation').      $datatable .= '<span class="LC_nobreak">('.&mt('overrides affiliation').
                   ')</span</td></tr>';                    ')</span></td></tr>';
     $$rowtotal += $typecount;      $$rowtotal += $typecount;
     return $datatable;      return $datatable;
 }  }
Line 1892  sub usercreation_types { Line 1894  sub usercreation_types {
                     any        => 'Any',                      any        => 'Any',
                     official   => 'Institutional only ',                      official   => 'Institutional only ',
                     unofficial => 'Non-institutional only',                      unofficial => 'Non-institutional only',
                     email      => 'Email address',                      email      => 'E-mail address',
                     login      => 'Institutional Login',                      login      => 'Institutional Login',
                     sso        => 'SSO',                       sso        => 'SSO', 
                     none       => 'None',                      none       => 'None',
Line 2371  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 3610  sub modify_quotas { Line 3612  sub modify_quotas {
                 }                  }
                 $resulttext .= '</ul></li>';                  $resulttext .= '</ul></li>';
             }              }
               my %newenv;
             foreach my $item (@usertools) {              foreach my $item (@usertools) {
                 if (ref($changes{$item}) eq 'HASH') {                  if (ref($changes{$item}) eq 'HASH') {
                     my $hashid = $env{'user.name'}.':'.$env{'user.domain'};                      my $newacc = 
                     &Apache::lonnet::devalidate_cache_new('usertools.'.$item,$hashid);                          &Apache::lonnet::usertools_access($env{'user.name'},
                                                             $env{'user.domain'},
                                                             $item,'reload');
                       if ($env{'environment.availabletools.'.$item} ne $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') {
                         if ($changes{$item}{$type}) {                          if ($changes{$item}{$type}) {
Line 3634  sub modify_quotas { Line 3642  sub modify_quotas {
                 }                  }
             }              }
             $resulttext .= '</ul>';              $resulttext .= '</ul>';
               if (keys(%newenv)) {
                   &Apache::lonnet::appenv(\%newenv);
               }
         } else {          } else {
             $resulttext = &mt('No changes made to availability of home pages, blogs, portfolios or default quotas');              $resulttext = &mt('No changes made to availability of home pages, blogs, portfolios or default quotas');
         }          }
Line 4966  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'});  
             my @newmachines = split(/,/,$newserverstatus{$type}{'machines'});  
             foreach my $item (@currmachines) {  
                 if (!grep(/^\Q$item\E$/,@newmachines)) {  
                     $changes{$type}{'machines'} = 1;  
                     last;  
                 }                  }
             }              }
             foreach my $item (@newmachines) {              if ($newserverstatus{$type}{$setting} ne '') {
                 if (!grep(/^\Q$item\E$/,@currmachines)) {                  @new = split(/,/,$newserverstatus{$type}{$setting});
                     $changes{$type}{'machines'} = 1;              }
                     last;              if (@current > 0) {
                   if (@new > 0) {
                       foreach my $item (@current) {
                           if (!grep(/^\Q$item\E$/,@new)) {
                               $changes{$type}{$setting} = 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.78  
changed lines
  Added in v.1.85


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.