Diff for /loncom/interface/domainprefs.pm between versions 1.282 and 1.284

version 1.282, 2016/10/05 13:59:46 version 1.284, 2016/12/05 00:51:53
Line 4690  sub print_loadbalancing { Line 4690  sub print_loadbalancing {
         my ($numspares,@spares) = &count_servers($lonhost,%servers);          my ($numspares,@spares) = &count_servers($lonhost,%servers);
         my @sparestypes = ('primary','default');          my @sparestypes = ('primary','default');
         my %typetitles = &sparestype_titles();          my %typetitles = &sparestype_titles();
           my %hostherechecked = (
                                     no => ' checked="checked"',
                                 );
         foreach my $sparetype (@sparestypes) {          foreach my $sparetype (@sparestypes) {
             my $targettable;              my $targettable;
             for (my $i=0; $i<$numspares; $i++) {              for (my $i=0; $i<$numspares; $i++) {
Line 4735  sub print_loadbalancing { Line 4738  sub print_loadbalancing {
                 $datatable .=  '<i>'.$typetitles{$sparetype}.'</i><br />'.                  $datatable .=  '<i>'.$typetitles{$sparetype}.'</i><br />'.
                                '<table><tr>'.$targettable.'</tr></table><br />';                                 '<table><tr>'.$targettable.'</tr></table><br />';
             }              }
               $hostherechecked{$sparetype} = '';
               if (ref($currtargets{$lonhost}) eq 'HASH') {
                   if (ref($currtargets{$lonhost}{$sparetype}) eq 'ARRAY') {
                       if (grep(/^\Q$lonhost\E$/,@{$currtargets{$lonhost}{$sparetype}})) {
                           $hostherechecked{$sparetype} = ' checked="checked"';
                           $hostherechecked{'no'} = '';
                       }
                   }
               }
           }
           $datatable .= &mt('Hosting on balancer itself').'<br />'.
                         '<label><input type="radio" name="loadbalancing_target_'.$balnum.'_hosthere" value="no"'.
                         $hostherechecked{'no'}.' />'.&mt('No').'</label><br />';
           foreach my $sparetype (@sparestypes) {
               $datatable .= '<label><input type="radio" name="loadbalancing_target_'.$balnum.'_hosthere" '.
                             'value="'.$sparetype.'"'.$hostherechecked{$sparetype}.' /><i>'.$typetitles{$sparetype}.
                             '</i></label><br />';
         }          }
         $datatable .= '</div></td></tr>'.          $datatable .= '</div></td></tr>'.
                       &loadbalancing_rules($dom,$intdom,$currrules{$lonhost},                        &loadbalancing_rules($dom,$intdom,$currrules{$lonhost},
Line 11853  sub modify_helpsettings { Line 11873  sub modify_helpsettings {
         $rolename=~s/[^A-Za-z0-9]//gs;          $rolename=~s/[^A-Za-z0-9]//gs;
         if ($rolename ne '') {          if ($rolename ne '') {
             unless(exists($existing{'rolesdef_'.$rolename})) {              unless(exists($existing{'rolesdef_'.$rolename})) {
                 my $errmsg;                  my %newprivs = &Apache::lonuserutils::custom_role_update($rolename,$prefix);
                 my $result = &Apache::lonuserutils::store_custom_role($rolename,$prefix,                  my $result = &Apache::lonnet::definerole($rolename,$newprivs{'s'},$newprivs{'d'},
                                                                       $confname,$dom);                                                           $newprivs{'c'},$confname,$dom);
                 if ($result eq 'ok') {                  if ($result eq 'ok') {
                     $changes{'newcustomrole'} = $rolename;                      $changes{'newcustomrole'} = $rolename;
                 } else {                  } else {
                     $errmsg = ': '.$result;                      $errors .= '<li><span class="LC_error">'.
                                  &mt('An error occurred storing the new custom role: [_1]',
                                      $result).'</span></li>';
                 }                  }
             }              }
         }          }
Line 13192  sub modify_loadbalancing { Line 13214  sub modify_loadbalancing {
                         push(@offloadto,$target);                          push(@offloadto,$target);
                     }                      }
                 }                  }
                 $defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype} = \@offloadto;  
             }              }
               if ($env{'form.loadbalancing_target_'.$i.'_hosthere'} eq $sparetype) {
                   unless(grep(/^\Q$balancer\E$/,@offloadto)) {
                       push(@offloadto,$balancer);
                   }
               }
               $defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype} = \@offloadto;
         }          }
         if (ref($currtargets{$balancer}) eq 'HASH') {          if (ref($currtargets{$balancer}) eq 'HASH') {
             foreach my $sparetype (@sparestypes) {              foreach my $sparetype (@sparestypes) {

Removed from v.1.282  
changed lines
  Added in v.1.284


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