Diff for /loncom/interface/domainprefs.pm between versions 1.160.6.57 and 1.254

version 1.160.6.57, 2015/03/11 17:15:40 version 1.254, 2014/10/06 00:48:39
Line 213  sub handler { Line 213  sub handler {
                 'quotas','autoenroll','autoupdate','autocreate',                  'quotas','autoenroll','autoupdate','autocreate',
                 'directorysrch','usercreation','usermodification',                  'directorysrch','usercreation','usermodification',
                 'contacts','defaults','scantron','coursecategories',                  'contacts','defaults','scantron','coursecategories',
                 'serverstatuses','requestcourses','coursedefaults',                  'serverstatuses','requestcourses','helpsettings',
                 'usersessions','loadbalancing','requestauthor',                  'coursedefaults','usersessions','loadbalancing',
                 'selfenrollment','inststatus'],$dom);                  'requestauthor','selfenrollment','inststatus'],$dom);
     my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll',      my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll',
                        'autoupdate','autocreate','directorysrch','contacts',                         'autoupdate','autocreate','directorysrch','contacts',
                        'usercreation','selfcreation','usermodification','scantron',                         'usercreation','selfcreation','usermodification','scantron',
                        'requestcourses','requestauthor','coursecategories',                         'requestcourses','requestauthor','coursecategories',
                        'serverstatuses','coursedefaults','selfenrollment',                         'serverstatuses','helpsettings',
                        'usersessions');                         'coursedefaults','selfenrollment','usersessions');
     my %existing;      my %existing;
     if (ref($domconfig{'loadbalancing'}) eq 'HASH') {      if (ref($domconfig{'loadbalancing'}) eq 'HASH') {
         %existing = %{$domconfig{'loadbalancing'}};          %existing = %{$domconfig{'loadbalancing'}};
Line 250  sub handler { Line 250  sub handler {
                       header => [{col1 => 'Log-in Page Items',                        header => [{col1 => 'Log-in Page Items',
                                   col2 => '',},                                    col2 => '',},
                                  {col1 => 'Log-in Help',                                   {col1 => 'Log-in Help',
                                   col2 => 'Value'},  
                                  {col1 => 'Custom HTML in document head',  
                                   col2 => 'Value'}],                                    col2 => 'Value'}],
                       print => \&print_login,                        print => \&print_login,
                       modify => \&modify_login,                        modify => \&modify_login,
Line 411  sub handler { Line 409  sub handler {
                   print => \&print_serverstatuses,                    print => \&print_serverstatuses,
                   modify => \&modify_serverstatuses,                    modify => \&modify_serverstatuses,
                  },                   },
           'helpsettings' =>
                    {text   => 'Help page settings',
                     help   => 'Domain_Configuration_Help_Settings',
                     header => [{col1 => 'Help Settings (logged-in users)',
                                 col2 => 'Value'}],
                     print  => \&print_helpsettings,
                     modify => \&modify_helpsettings,
                    },
         'coursedefaults' =>           'coursedefaults' => 
                  {text => 'Course/Community defaults',                   {text => 'Course/Community defaults',
                   help => 'Domain_Configuration_Course_Defaults',                    help => 'Domain_Configuration_Course_Defaults',
Line 433  sub handler { Line 439  sub handler {
                   print => \&print_selfenrollment,                    print => \&print_selfenrollment,
                   modify => \&modify_selfenrollment,                    modify => \&modify_selfenrollment,
                  },                   },
           'privacy' => 
                    {text   => 'User Privacy',
                     help   => 'Domain_Configuration_User_Privacy',
                     header => [{col1 => 'Setting',
                                 col2 => 'Value',}],
                     print => \&print_privacy,
                     modify => \&modify_privacy,
                    },
         'usersessions' =>          'usersessions' =>
                  {text  => 'User session hosting/offloading',                   {text  => 'User session hosting/offloading',
                   help  => 'Domain_Configuration_User_Sessions',                    help  => 'Domain_Configuration_User_Sessions',
Line 465  sub handler { Line 479  sub handler {
                                        {col1 => 'Log-in Page Items',                                         {col1 => 'Log-in Page Items',
                                         col2 => ''},                                          col2 => ''},
                                        {col1 => 'Log-in Help',                                         {col1 => 'Log-in Help',
                                         col2 => 'Value'},  
                                        {col1 => 'Custom HTML in document head',  
                                         col2 => 'Value'}],                                          col2 => 'Value'}],
                             print => \&print_login,                              print => \&print_login,
                             modify => \&modify_login,                              modify => \&modify_login,
Line 619  sub process_changes { Line 631  sub process_changes {
         $output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig);          $output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig);
     } elsif ($action eq 'requestauthor') {      } elsif ($action eq 'requestauthor') {
         $output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig);          $output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig);
       } elsif ($action eq 'helpsettings') {
           $output = &modify_helpsettings($r,$dom,$confname,%domconfig);
     } elsif ($action eq 'coursedefaults') {      } elsif ($action eq 'coursedefaults') {
         $output = &modify_coursedefaults($dom,$lastactref,%domconfig);          $output = &modify_coursedefaults($dom,$lastactref,%domconfig);
     } elsif ($action eq 'selfenrollment') {      } elsif ($action eq 'selfenrollment') {
Line 656  sub print_config_box { Line 670  sub print_config_box {
         my $colspan = '';          my $colspan = '';
         my $rightcolspan = '';          my $rightcolspan = '';
         if (($action eq 'rolecolors') || ($action eq 'defaults') ||          if (($action eq 'rolecolors') || ($action eq 'defaults') ||
             (($action eq 'login') && ($numheaders < 4))) {              (($action eq 'login') && ($numheaders < 3))) {
             $colspan = ' colspan="2"';              $colspan = ' colspan="2"';
         }          }
         if ($action eq 'usersessions') {          if ($action eq 'usersessions') {
Line 678  sub print_config_box { Line 692  sub print_config_box {
         } elsif ($action eq 'coursecategories') {          } elsif ($action eq 'coursecategories') {
             $output .= $item->{'print'}->('top',$dom,$item,$settings,\$rowtotal);              $output .= $item->{'print'}->('top',$dom,$item,$settings,\$rowtotal);
         } elsif ($action eq 'login') {          } elsif ($action eq 'login') {
             if ($numheaders == 4) {              if ($numheaders == 3) {
                 $colspan = ' colspan="2"';                  $colspan = ' colspan="2"';
                 $output .= &print_login('service',$dom,$confname,$phase,$settings,\$rowtotal);                  $output .= &print_login('service',$dom,$confname,$phase,$settings,\$rowtotal);
             } else {              } else {
Line 731  sub print_config_box { Line 745  sub print_config_box {
                   ($action eq 'defaults')) {                    ($action eq 'defaults')) {
             $output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);              $output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
         } elsif ($action eq 'login') {          } elsif ($action eq 'login') {
             if ($numheaders == 4) {              if ($numheaders == 3) {
                 $output .= &print_login('page',$dom,$confname,$phase,$settings,\$rowtotal).'                  $output .= &print_login('page',$dom,$confname,$phase,$settings,\$rowtotal).'
            </table>             </table>
           </td>            </td>
Line 747  sub print_config_box { Line 761  sub print_config_box {
             } else {              } else {
                 $output .= &print_login('help',$dom,$confname,$phase,$settings,\$rowtotal);                  $output .= &print_login('help',$dom,$confname,$phase,$settings,\$rowtotal);
             }              }
             $output .= '  
            </table>  
           </td>  
          </tr>  
          <tr>  
            <td>  
             <table class="LC_nested">  
              <tr class="LC_info_row">';  
             if ($numheaders == 4) {  
                 $output .= '  
               <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col1'}).'</td>  
               <td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col2'}).'</td>  
              </tr>';  
             } else {  
                 $output .= '  
               <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td>  
               <td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col2'}).'</td>  
              </tr>';  
             }  
             $rowtotal ++;  
             $output .= &print_login('headtag',$dom,$confname,$phase,$settings,\$rowtotal);  
         } elsif ($action eq 'requestcourses') {          } elsif ($action eq 'requestcourses') {
             $output .= &print_requestmail($dom,$action,$settings,\$rowtotal);              $output .= &print_requestmail($dom,$action,$settings,\$rowtotal);
             $rowtotal ++;              $rowtotal ++;
Line 892  sub print_config_box { Line 885  sub print_config_box {
             $output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal);              $output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal);
         } elsif ($action eq 'helpsettings') {          } elsif ($action eq 'helpsettings') {
             $output .= &print_helpsettings($dom,$confname,$settings,\$rowtotal);              $output .= &print_helpsettings($dom,$confname,$settings,\$rowtotal);
         } elsif ($action eq 'coursedefaults') {  
             $output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);  
         }          }
     }      }
     $output .= '      $output .= '
Line 1190  sub print_login { Line 1181  sub print_login {
             $itemcount ++;              $itemcount ++;
         }          }
         $datatable .= &captcha_choice('login',$settings,$itemcount);          $datatable .= &captcha_choice('login',$settings,$itemcount);
     } elsif ($caller eq 'headtag') {  
         my %domservers = &Apache::lonnet::get_servers($dom);  
         my $choice = $choices{'headtag'};  
         $css_class = ' class="LC_odd_row"';  
         $datatable .= '<tr'.$css_class.'><td colspan="2">'.$choice.'</td>'.  
                       '<td align="left"><table><tr><th>'.$choices{'hostid'}.'</th>'.  
                       '<th>'.$choices{'current'}.'</th>'.  
                       '<th>'.$choices{'action'}.'</th>'.  
                       '<th>'.$choices{'exempt'}.'</th></tr>'."\n";  
         my (%currurls,%currexempt);  
         if (ref($settings) eq 'HASH') {  
             if (ref($settings->{'headtag'}) eq 'HASH') {  
                 foreach my $lonhost (keys(%{$settings->{'headtag'}})) {  
                     if (ref($settings->{'headtag'}{$lonhost}) eq 'HASH') {  
                         $currurls{$lonhost} = $settings->{'headtag'}{$lonhost}{'url'};  
                         $currexempt{$lonhost} = $settings->{'headtag'}{$lonhost}{'exempt'};  
                     }  
                 }  
             }  
         }  
         my %lt = &Apache::lonlocal::texthash(  
                                                del  => 'Delete?',  
                                                rep  => 'Replace:',  
                                                upl  => 'Upload:',  
                                                curr => 'View contents',  
                                                none => 'None',  
         );  
         my $switchserver = &check_switchserver($dom,$confname);  
         foreach my $lonhost (sort(keys(%domservers))) {  
             my $exempt = &check_exempt_addresses($currexempt{$lonhost});  
             $datatable .= '<tr><td>'.$domservers{$lonhost}.'</td>';  
             if ($currurls{$lonhost}) {  
                 $datatable .= '<td class="LC_right_item"><a href="'.  
                               "javascript:void(open('$currurls{$lonhost}?inhibitmenu=yes','Custom_HeadTag',  
                               'menubar=0,toolbar=1,scrollbars=1,width=600,height=500,resizable=yes'))".  
                               '">'.$lt{'curr'}.'</a></td>'.  
                               '<td><span class="LC_nobreak"><label>'.  
                               '<input type="checkbox" name="loginheadtag_del" value="'.$lonhost.'" />'.  
                               $lt{'del'}.'</label>&nbsp;'.$lt{'rep'}.'</span>';  
             } else {  
                 $datatable .= '<td class="LC_right_item">'.$lt{'none'}.'</td><td>'.$lt{'upl'};  
             }  
             $datatable .='<br />';  
             if ($switchserver) {  
                 $datatable .= &mt('Upload to library server: [_1]',$switchserver);  
             } else {  
                 $datatable .= '<input type="file" name="loginheadtag_'.$lonhost.'" />';  
             }  
             $datatable .= '</td><td><input type="textbox" name="loginheadtagexempt_'.$lonhost.'" value="'.$exempt.'" /></td></tr>';  
         }  
         $datatable .= '</table></td></tr>';  
     }      }
     return $datatable;      return $datatable;
 }  }
Line 1274  sub login_choices { Line 1214  sub login_choices {
             link          => "Link",              link          => "Link",
             alink         => "Active link",              alink         => "Active link",
             vlink         => "Visited link",              vlink         => "Visited link",
             headtag       => "Custom markup",  
             action        => "Action",  
             current       => "Current",  
         );          );
     return %choices;      return %choices;
 }  }
Line 2828  sub print_helpsettings { Line 2765  sub print_helpsettings {
   
 sub radiobutton_prefs {  sub radiobutton_prefs {
     my ($settings,$toggles,$defaultchecked,$choices,$itemcount,$onclick,      my ($settings,$toggles,$defaultchecked,$choices,$itemcount,$onclick,
         $additional,$align) = @_;          $additional) = @_;
     return unless ((ref($toggles) eq 'ARRAY') && (ref($defaultchecked) eq 'HASH') &&      return unless ((ref($toggles) eq 'ARRAY') && (ref($defaultchecked) eq 'HASH') &&
                    (ref($choices) eq 'HASH'));                     (ref($choices) eq 'HASH'));
   
Line 2862  sub radiobutton_prefs { Line 2799  sub radiobutton_prefs {
         $datatable .=          $datatable .=
             '<tr'.$css_class.'><td valign="top">'.              '<tr'.$css_class.'><td valign="top">'.
             '<span class="LC_nobreak">'.$choices->{$item}.              '<span class="LC_nobreak">'.$choices->{$item}.
             '</span></td>';              '</span></td>'.
         if ($align eq 'left') {              '<td class="LC_right_item"><span class="LC_nobreak">'.
             $datatable .= '<td class="LC_left_item">';  
         } else {  
             $datatable .= '<td class="LC_right_item">';  
         }  
         $datatable .=  
             '<span class="LC_nobreak">'.  
             '<label><input type="radio" name="'.              '<label><input type="radio" name="'.
             $item.'" '.$checkedon{$item}.' value="1"'.$onclick.' />'.&mt('Yes').              $item.'" '.$checkedon{$item}.' value="1"'.$onclick.' />'.&mt('Yes').
             '</label>&nbsp;<label><input type="radio" name="'.$item.'" '.              '</label>&nbsp;<label><input type="radio" name="'.$item.'" '.
Line 2887  sub print_coursedefaults { Line 2818  sub print_coursedefaults {
     my ($css_class,$datatable,%checkedon,%checkedoff,%defaultchecked,@toggles);      my ($css_class,$datatable,%checkedon,%checkedoff,%defaultchecked,@toggles);
     my $itemcount = 1;      my $itemcount = 1;
     my %choices =  &Apache::lonlocal::texthash (      my %choices =  &Apache::lonlocal::texthash (
           canuse_pdfforms      => 'Course/Community users can create/upload PDF forms',
         uploadquota          => 'Default quota for files uploaded directly to course/community using Course Editor (MB)',          uploadquota          => 'Default quota for files uploaded directly to course/community using Course Editor (MB)',
         anonsurvey_threshold => 'Responder count needed before showing submissions for anonymous surveys',          anonsurvey_threshold => 'Responder count needed before showing submissions for anonymous surveys',
         coursecredits        => 'Credits can be specified for courses',          coursecredits        => 'Credits can be specified for courses',
         uselcmath            => 'Math preview uses LON-CAPA previewer (javascript) in place of DragMath (Java)',  
         usejsme              => 'Molecule editor uses JSME (HTML5) in place of JME (Java)',  
         postsubmit           => 'Disable submit button/keypress following student submission',  
     );      );
     my %staticdefaults = (      my %staticdefaults = (
                            anonsurvey_threshold => 10,                             anonsurvey_threshold => 10,
                            uploadquota          => 500,                             uploadquota          => 500,
                            postsubmit           => 60,  
                          );                           );
     if ($position eq 'top') {      if ($position eq 'top') {
         %defaultchecked = (          %defaultchecked = ('canuse_pdfforms' => 'off');
                             'uselcmath'       => 'on',          @toggles = ('canuse_pdfforms');
                             'usejsme'         => 'on',  
                           );  
         @toggles = ('uselcmath','usejsme');  
         ($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked,          ($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked,
                                                      \%choices,$itemcount);                                                   \%choices,$itemcount);
     } else {      } else {
         $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';          $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
         my ($currdefresponder,%defcredits,%curruploadquota,%deftimeout);          my ($currdefresponder,$def_official_credits,$def_unofficial_credits,$def_textbook_credits,
               %curruploadquota);
         my $currusecredits = 0;          my $currusecredits = 0;
         my $postsubmitclient = 1;  
         my @types = ('official','unofficial','community','textbook');          my @types = ('official','unofficial','community','textbook');
         if (ref($settings) eq 'HASH') {          if (ref($settings) eq 'HASH') {
             $currdefresponder = $settings->{'anonsurvey_threshold'};              $currdefresponder = $settings->{'anonsurvey_threshold'};
Line 2921  sub print_coursedefaults { Line 2846  sub print_coursedefaults {
                 }                  }
             }              }
             if (ref($settings->{'coursecredits'}) eq 'HASH') {              if (ref($settings->{'coursecredits'}) eq 'HASH') {
                 foreach my $type (@types) {                  $def_official_credits = $settings->{'coursecredits'}->{'official'};
                     next if ($type eq 'community');                  $def_unofficial_credits = $settings->{'coursecredits'}->{'unofficial'};
                     $defcredits{$type} = $settings->{'coursecredits'}->{$type};                  $def_textbook_credits = $settings->{'coursecredits'}->{'textbook'};
                     if ($defcredits{$type} ne '') {                  if (($def_official_credits ne '') || ($def_unofficial_credits ne '') ||
                         $currusecredits = 1;                      ($def_textbook_credits ne '')) {
                     }                      $currusecredits = 1;
                 }  
             }  
             if (ref($settings->{'postsubmit'}) eq 'HASH') {  
                 if ($settings->{'postsubmit'}->{'client'} eq 'off') {  
                     $postsubmitclient = 0;  
                     foreach my $type (@types) {  
                         $deftimeout{$type} = $staticdefaults{'postsubmit'};  
                     }  
                 } else {  
                     foreach my $type (@types) {  
                         if (ref($settings->{'postsubmit'}->{'timeout'}) eq 'HASH') {  
                             if ($settings->{'postsubmit'}->{'timeout'}->{$type} =~ /^\d+$/) {  
                                 $deftimeout{$type} = $settings->{'postsubmit'}->{'timeout'}->{$type};  
                             } else {  
                                 $deftimeout{$type} = $staticdefaults{'postsubmit'};  
                             }  
                         } else {  
                             $deftimeout{$type} = $staticdefaults{'postsubmit'};  
                         }  
                     }  
                 }  
             } else {  
                 foreach my $type (@types) {  
                     $deftimeout{$type} = $staticdefaults{'postsubmit'};  
                 }                  }
             }              }
         }          }
Line 2992  sub print_coursedefaults { Line 2893  sub print_coursedefaults {
             $display = 'block';              $display = 'block';
         }          }
         my $additional = '<div id="credits" style="display: '.$display.'">'.          my $additional = '<div id="credits" style="display: '.$display.'">'.
                          '<i>'.&mt('Default credits').'</i><br /><table><tr>';                           '<span class="LC_nobreak">'.
         foreach my $type (@types) {                           &mt('Default credits for official courses [_1]',
             next if ($type eq 'community');                           '<input type="text" name="official_credits" value="'.
             $additional .= '<td align="center">'.&mt($type).'<br />'.                           $def_official_credits.'" size="3" />').
                            '<input type="text" name="'.$type.'_credits"'.                           '</span><br />'.
                            ' value="'.$defcredits{$type}.'" size="3" /></td>';                           '<span class="LC_nobreak">'.
         }                           &mt('Default credits for unofficial courses [_1]',
         $additional .= '</tr></table></div>'."\n";                           '<input type="text" name="unofficial_credits" value="'.
                            $def_unofficial_credits.'" size="3" />').
                            '</span><br />'.
                            '<span class="LC_nobreak">'.
                            &mt('Default credits for textbook courses [_1]',
                            '<input type="text" name="textbook_credits" value="'.
                            $def_textbook_credits.'" size="3" />').
                            '</span></div>'."\n";
         %defaultchecked = ('coursecredits' => 'off');          %defaultchecked = ('coursecredits' => 'off');
         @toggles = ('coursecredits');          @toggles = ('coursecredits');
         my $current = {          my $current = {
Line 3007  sub print_coursedefaults { Line 2915  sub print_coursedefaults {
                       };                        };
         (my $table,$itemcount) =          (my $table,$itemcount) =
             &radiobutton_prefs($current,\@toggles,\%defaultchecked,              &radiobutton_prefs($current,\@toggles,\%defaultchecked,
                                \%choices,$itemcount,$onclick,$additional,'left');                                 \%choices,$itemcount,$onclick,$additional);
         $datatable .= $table;  
         $onclick = "toggleDisplay(this.form,'studentsubmission');";  
         my $display = 'none';  
         if ($postsubmitclient) {  
             $display = 'block';  
         }  
         $additional = '<div id="studentsubmission" style="display: '.$display.'">'.  
                       '<i>'.&mt('Number of seconds submit is disabled').'</i><br /><table><tr>';  
         foreach my $type (@types) {  
             $additional .= '<td align="center">'.&mt($type).'<br />'.  
                            '<input type="text" name="'.$type.'_timeout" value="'.  
                            $deftimeout{$type}.'" size="5" /></td>';  
         }  
         $additional .= '</tr></table></div>'."\n";  
         %defaultchecked = ('postsubmit' => 'on');  
         @toggles = ('postsubmit');  
         my $current = {  
                         'postsubmit' => $postsubmitclient,  
                       };  
         ($table,$itemcount) =  
             &radiobutton_prefs($current,\@toggles,\%defaultchecked,  
                                \%choices,$itemcount,$onclick,$additional,'left');  
         $datatable .= $table;          $datatable .= $table;
           $itemcount ++;
     }      }
     $$rowtotal += $itemcount;      $$rowtotal += $itemcount;
     return $datatable;      return $datatable;
Line 5292  sub serverstatus_pages { Line 5179  sub serverstatus_pages {
   
 sub defaults_javascript {  sub defaults_javascript {
     my ($settings) = @_;      my ($settings) = @_;
     return unless (ref($settings) eq 'HASH');      return unless (ref($settings) eq 'HASH'); 
     if ((ref($settings->{'inststatusorder'}) eq 'ARRAY') && (ref($settings->{'inststatustypes'}) eq 'HASH')) {      if ((ref($settings->{'inststatusorder'}) eq 'ARRAY') && (ref($settings->{'inststatustypes'}) eq 'HASH')) {
         my $maxnum = scalar(@{$settings->{'inststatusorder'}});          my $maxnum = scalar(@{$settings->{'inststatusorder'}});
         if ($maxnum eq '') {          if ($maxnum eq '') {
Line 5892  sub modify_login { Line 5779  sub modify_login {
     }      }
   
     my %servers = &Apache::lonnet::internet_dom_servers($dom);      my %servers = &Apache::lonnet::internet_dom_servers($dom);
     my %domservers = &Apache::lonnet::get_servers($dom);  
     my @loginvia_attribs = ('serverpath','custompath','exempt');      my @loginvia_attribs = ('serverpath','custompath','exempt');
     if (keys(%servers) > 1) {      if (keys(%servers) > 1) {
         foreach my $lonhost (keys(%servers)) {          foreach my $lonhost (keys(%servers)) {
Line 5935  sub modify_login { Line 5821  sub modify_login {
                             $changes{'loginvia'}{$lonhost} = 1;                              $changes{'loginvia'}{$lonhost} = 1;
                         }                          }
                         if ($item eq 'exempt') {                          if ($item eq 'exempt') {
                             $new = &check_exempt_addresses($new);                              $new =~ s/^\s+//;
                               $new =~ s/\s+$//;
                               my @poss_ips = split(/\s*[,:]\s*/,$new);
                               my @okips;
                               foreach my $ip (@poss_ips) {
                                   if ($ip =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) {
                                       if (($1 <= 255) && ($2 <= 255) && ($3 <= 255) && ($4 <= 255)) {
                                           push(@okips,$ip); 
                                       }
                                   }
                               }
                               if (@okips > 0) {
                                   $new = join(',',@okips); 
                               } else {
                                   $new = ''; 
                               }
                         }                          }
                         $loginhash{login}{loginvia}{$lonhost}{$item} = $new;                          $loginhash{login}{loginvia}{$lonhost}{$item} = $new;
                     }                      }
Line 6047  sub modify_login { Line 5948  sub modify_login {
             $errors .= '<li><span class="LC_error">'.$error.'</span></li>';              $errors .= '<li><span class="LC_error">'.$error.'</span></li>';
         }          }
     }      }
   
     my (%currheadtagurls,%currexempt,@newhosts,%newheadtagurls,%possexempt);  
     if (ref($domconfig{'login'}) eq 'HASH') {  
         if (ref($domconfig{'login'}{'headtag'}) eq 'HASH') {  
             foreach my $lonhost (keys(%{$domconfig{'login'}{'headtag'}})) {  
                 if ($domservers{$lonhost}) {  
                     if (ref($domconfig{'login'}{'headtag'}{$lonhost}) eq 'HASH') {  
                         $currheadtagurls{$lonhost} = $domconfig{'login'}{'headtag'}{$lonhost}{'url'};  
                         $currexempt{$lonhost} = $domconfig{'login'}{'headtagexempt'}{$lonhost}{'exempt'}  
                     }  
                 }  
             }  
         }  
     }  
     my @delheadtagurls = &Apache::loncommon::get_env_multiple('form.loginheadtag_del');  
     foreach my $lonhost (sort(keys(%domservers))) {  
         if (grep(/^\Q$lonhost\E$/,@delheadtagurls)) {  
             $changes{'headtag'}{$lonhost} = 1;  
         } else {  
             if ($env{'form.loginheadtagexempt_'.$lonhost}) {  
                 $possexempt{$lonhost} = &check_exempt_addresses($env{'form.loginheadtagexempt_'.$lonhost});  
             }  
             if ($env{'form.loginheadtag_'.$lonhost.'.filename'}) {  
                 push(@newhosts,$lonhost);  
             } elsif ($currheadtagurls{$lonhost}) {  
                 $loginhash{'login'}{'headtag'}{$lonhost}{'url'} = $currheadtagurls{$lonhost};  
                 if ($currexempt{$lonhost}) {  
                     if ((!exists($possexempt{$lonhost})) || ($possexempt{$lonhost} ne $currexempt{$lonhost})) {  
                         $changes{'headtag'}{$lonhost} = 1;  
                     }  
                 } elsif ($possexempt{$lonhost}) {  
                     $changes{'headtag'}{$lonhost} = 1;  
                 }  
                 if ($possexempt{$lonhost}) {  
                     $loginhash{'login'}{'headtag'}{$lonhost}{'exempt'} = $possexempt{$lonhost};  
                 }  
             }  
         }  
     }  
     if (@newhosts) {  
         my $error;  
         my ($configuserok,$author_ok,$switchserver) = &config_check($dom,$confname,$servadm);  
         if ($configuserok eq 'ok') {  
             if ($switchserver) {  
                 $error = &mt("Upload of custom markup is not permitted to this server: [_1]",$switchserver);  
             } elsif ($author_ok eq 'ok') {  
                 foreach my $lonhost (@newhosts) {  
                     my $formelem = 'loginheadtag_'.$lonhost;  
                     (my $result,$newheadtagurls{$lonhost}) = &publishlogo($r,'upload',$formelem,$dom,$confname,  
                                                                           "login/headtag/$lonhost",'','',  
                                                                           $env{'form.loginheadtag_'.$lonhost.'.filename'});  
                     if ($result eq 'ok') {  
                         $loginhash{'login'}{'headtag'}{$lonhost}{'url'} = $newheadtagurls{$lonhost};  
                         $changes{'headtag'}{$lonhost} = 1;  
                         if ($possexempt{$lonhost}) {  
                             $loginhash{'login'}{'headtag'}{$lonhost}{'exempt'} = $possexempt{$lonhost};  
                         }  
                     } else {  
                         my $puberror = &mt("Upload of [_1] failed because an error occurred publishing the file in RES space. Error was: [_2].",  
                                            $newheadtagurls{$lonhost},$result);  
                         $errors .= '<li><span class="LC_error">'.$puberror.'</span></li>';  
                         if ((grep(/^\Q$lonhost\E$/,keys(%currheadtagurls))) &&  
                             (!grep(/^\Q$lonhost\E$/,@delheadtagurls))) {  
                             $loginhash{'login'}{'headtag'}{$lonhost} = $currheadtagurls{$lonhost};  
                         }  
                     }  
                 }  
             } else {  
                 $error = &mt("Upload of custom markup file(s) failed because an author role could not be assigned to a Domain Configuration user ([_1]) in domain: [_2].  Error was: [_3].",$confname,$dom,$author_ok);  
             }  
         } else {  
             $error = &mt("Upload of custom markup file(s) failed because a Domain Configuration user ([_1]) could not be created in domain: [_2].  Error was: [_3].",$confname,$dom,$configuserok);  
         }  
         if ($error) {  
             &Apache::lonnet::logthis($error);  
             $errors .= '<li><span class="LC_error">'.$error.'</span></li>';  
         }  
     }  
   
     &process_captcha('login',\%changes,$loginhash{'login'},$domconfig{'login'});      &process_captcha('login',\%changes,$loginhash{'login'},$domconfig{'login'});
   
     my $defaulthelpfile = '/adm/loginproblems.html';      my $defaulthelpfile = '/adm/loginproblems.html';
Line 6226  sub modify_login { Line 6048  sub modify_login {
                             }                              }
                         }                          }
                     }                      }
                 } elsif ($item eq 'headtag') {  
                     if (ref($changes{$item}) eq 'HASH') {  
                         foreach my $lonhost (sort(keys(%{$changes{$item}}))) {  
                             if (grep(/^\Q$lonhost\E$/,@delheadtagurls)) {  
                                 $resulttext .= '<li>'.&mt('custom markup file removed for [_1]',$domservers{$lonhost}).'</li>';  
                             } elsif (ref($loginhash{'login'}{'headtag'}{$lonhost}) eq 'HASH') {  
                                 $resulttext .= '<li><a href="'.  
                                                "javascript:void(open('$loginhash{'login'}{'headtag'}{$lonhost}{'url'}?inhibitmenu=yes','Custom_HeadTag',  
                                                'menubar=0,toolbar=1,scrollbars=1,width=600,height=500,resizable=yes'))".  
                                                '">'.&mt('custom markup').'</a> '.&mt('(for [_1])',$servers{$lonhost}).' ';  
                                 if ($possexempt{$lonhost}) {  
                                     $resulttext .= &mt('not included for client IP(s): [_1]',$possexempt{$lonhost});  
                                 } else {  
                                     $resulttext .= &mt('included for any client IP');  
                                 }  
                                 $resulttext .= '</li>';  
                             }  
                         }  
                     }  
                 } elsif ($item eq 'captcha') {                  } elsif ($item eq 'captcha') {
                     if (ref($loginhash{'login'}) eq 'HASH') {                      if (ref($loginhash{'login'}) eq 'HASH') {
                         my $chgtxt;                          my $chgtxt;
Line 6300  sub modify_login { Line 6103  sub modify_login {
     return $resulttext;      return $resulttext;
 }  }
   
 sub check_exempt_addresses {  
     my ($iplist) = @_;  
     $iplist =~ s/^\s+//;  
     $iplist =~ s/\s+$//;  
     my @poss_ips = split(/\s*[,:]\s*/,$iplist);  
     my (@okips,$new);  
     foreach my $ip (@poss_ips) {  
         if ($ip =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) {  
             if (($1 <= 255) && ($2 <= 255) && ($3 <= 255) && ($4 <= 255)) {  
                 push(@okips,$ip);  
             }  
         }  
     }  
     if (@okips > 0) {  
         $new = join(',',@okips);  
     } else {  
         $new = '';  
     }  
     return $new;  
 }  
   
 sub color_font_choices {  sub color_font_choices {
     my %choices =      my %choices =
         &Apache::lonlocal::texthash (          &Apache::lonlocal::texthash (
Line 7209  sub modify_quotas { Line 6991  sub modify_quotas {
                                     my $newpos = $env{'form.'.$itemid};                                      my $newpos = $env{'form.'.$itemid};
                                     $newpos =~ s/\D+//g;                                      $newpos =~ s/\D+//g;
                                     foreach my $item ('subject','title','publisher','author') {                                      foreach my $item ('subject','title','publisher','author') {
                                         next if ((($item eq 'author') || ($item eq 'publisher')) &&                                          next if ((($item eq 'author') || ($item eq 'publisher')) && 
                                                  ($type eq 'templates'));                                                   ($type eq 'templates'));
                                         $confhash{$type}{$key}{$item} = $env{'form.'.$type.'_'.$item.'_'.$i};                                          $confhash{$type}{$key}{$item} = $env{'form.'.$type.'_'.$item.'_'.$i};
                                         if ($domconfig{$action}{$type}{$key}{$item} ne $confhash{$type}{$key}{$item}) {                                          if ($domconfig{$action}{$type}{$key}{$item} ne $confhash{$type}{$key}{$item}) {
Line 10209  sub modify_helpsettings { Line 9991  sub modify_helpsettings {
 sub modify_coursedefaults {  sub modify_coursedefaults {
     my ($dom,$lastactref,%domconfig) = @_;      my ($dom,$lastactref,%domconfig) = @_;
     my ($resulttext,$errors,%changes,%defaultshash);      my ($resulttext,$errors,%changes,%defaultshash);
     my %defaultchecked = (      my %defaultchecked = ('canuse_pdfforms' => 'off');
                            'uselcmath'       => 'on',      my @toggles = ('canuse_pdfforms');
                            'usejsme'         => 'on'  
                          );  
     my @toggles = ('uselcmath','usejsme');  
     my @numbers = ('anonsurvey_threshold','uploadquota_official','uploadquota_unofficial',      my @numbers = ('anonsurvey_threshold','uploadquota_official','uploadquota_unofficial',
                    'uploadquota_community','uploadquota_textbook');                     'uploadquota_community','uploadquota_textbook');
     my @types = ('official','unofficial','community','textbook');      my @types = ('official','unofficial','community','textbook');
     my %staticdefaults = (      my %staticdefaults = (
                            anonsurvey_threshold => 10,                             anonsurvey_threshold => 10,
                            uploadquota          => 500,                             uploadquota          => 500,
                            postsubmit           => 60,  
                          );                           );
   
     $defaultshash{'coursedefaults'} = {};      $defaultshash{'coursedefaults'} = {};
Line 10282  sub modify_coursedefaults { Line 10060  sub modify_coursedefaults {
             }              }
         }          }
   
         my %credits;          my $officialcreds = $env{'form.official_credits'};
         foreach my $type (@types) {          $officialcreds =~ s/[^\d.]+//g;
             unless ($type eq 'community') {          my $unofficialcreds = $env{'form.unofficial_credits'};
                 $credits{$type} = $env{'form.'.$type.'_credits'};          $unofficialcreds =~ s/[^\d.]+//g;
                 $credits{$type} =~ s/[^\d.]+//g;          my $textbookcreds = $env{'form.textbook_credits'};
             }          $textbookcreds =~ s/[^\d.]+//g;
         }          if (ref($domconfig{'coursedefaults'}{'coursecredits'} ne 'HASH') &&
         if ((ref($domconfig{'coursedefaults'}{'coursecredits'}) ne 'HASH') &&                  ($env{'form.coursecredits'} eq '1')) {
             ($env{'form.coursecredits'} eq '1')) {                  $changes{'coursecredits'} = 1;
             $changes{'coursecredits'} = 1;          } else {
             foreach my $type (keys(%credits)) {              if (($domconfig{'coursedefaults'}{'coursecredits'}{'official'} ne $officialcreds)  ||
                 $defaultshash{'coursedefaults'}{'coursecredits'}{$type} = $credits{$type};                  ($domconfig{'coursedefaults'}{'coursecredits'}{'unofficial'} ne $unofficialcreds) ||
             }                  ($domconfig{'coursedefaults'}{'coursecredits'}{'textbook'} ne $textbookcreds)) {
         } else {                  $changes{'coursecredits'} = 1;
             if ($env{'form.coursecredits'} eq '1') {              }
                 foreach my $type (@types) {          }
                     unless ($type eq 'community') {          $defaultshash{'coursedefaults'}{'coursecredits'} = {
                         if ($domconfig{'coursedefaults'}{'coursecredits'}{$type} ne $credits{$type}) {              official   => $officialcreds,
                             $changes{'coursecredits'} = 1;              unofficial => $unofficialcreds,
                         }              textbook   => $textbookcreds,
                         $defaultshash{'coursedefaults'}{'coursecredits'}{$type} = $credits{$type};  
                     }  
                 }  
             } elsif (ref($domconfig{'coursedefaults'}{'coursecredits'}) eq 'HASH') {  
                 foreach my $type (@types) {  
                     unless ($type eq 'community') {  
                         if ($domconfig{'coursedefaults'}{'coursecredits'}{$type}) {  
                             $changes{'coursecredits'} = 1;  
                             last;  
                         }  
                     }  
                 }  
             }  
         }  
         if ($env{'form.postsubmit'} eq '1') {  
             $defaultshash{'coursedefaults'}{'postsubmit'}{'client'} = 'on';  
             my %currtimeout;  
             if (ref($domconfig{'coursedefaults'}{'postsubmit'}) eq 'HASH') {  
                 if ($domconfig{'coursedefaults'}{'postsubmit'}{'client'} eq 'off') {  
                     $changes{'postsubmit'} = 1;  
                 }  
                 if (ref($domconfig{'coursedefaults'}{'postsubmit'}{'timeout'}) eq 'HASH') {  
                     %currtimeout = %{$domconfig{'coursedefaults'}{'postsubmit'}{'timeout'}};  
                 }  
             } else {  
                 $changes{'postsubmit'} = 1;  
             }  
             foreach my $type (@types) {  
                 my $timeout = $env{'form.'.$type.'_timeout'};  
                 $timeout =~ s/\D//g;  
                 if ($timeout == $staticdefaults{'postsubmit'}) {  
                     $timeout = '';  
                 } elsif (($timeout eq '') || ($timeout =~ /^0+$/)) {  
                     $timeout = '0';  
                 }  
                 unless ($timeout eq '') {  
                     $defaultshash{'coursedefaults'}{'postsubmit'}{'timeout'}{$type} = $timeout;  
                 }  
                 if (exists($currtimeout{$type})) {  
                     if ($timeout ne $currtimeout{$type}) {  
                         $changes{'postsubmit'} = 1;  
                     }  
                 } elsif ($timeout ne '') {  
                     $changes{'postsubmit'} = 1;  
                 }  
             }  
         } else {  
             $defaultshash{'coursedefaults'}{'postsubmit'}{'client'} = 'off';  
             if (ref($domconfig{'coursedefaults'}{'postsubmit'}) eq 'HASH') {  
                 if ($domconfig{'coursedefaults'}{'postsubmit'}{'client'} eq 'on') {  
                     $changes{'postsubmit'} = 1;  
                 }  
             } else {  
                 $changes{'postsubmit'} = 1;  
             }  
         }          }
     }      }
     my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash,      my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash,
Line 10364  sub modify_coursedefaults { Line 10087  sub modify_coursedefaults {
     if ($putresult eq 'ok') {      if ($putresult eq 'ok') {
         if (keys(%changes) > 0) {          if (keys(%changes) > 0) {
             my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1);              my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1);
             if (($changes{'uploadquota'}) || ($changes{'postsubmit'}) ||              if (($changes{'canuse_pdfforms'}) || ($changes{'coursecredits'}) || 
                 ($changes{'coursecredits'}) || ($changes{'uselcmath'}) || ($changes{'usejsme'})) {                  ($changes{'uploadquota'})) { 
                 foreach my $item ('uselcmath','usejsme') {                  if ($changes{'canuse_pdfforms'}) {
                     if ($changes{$item}) {                      $domdefaults{'canuse_pdfforms'}=$defaultshash{'coursedefaults'}{'canuse_pdfforms'};
                         $domdefaults{$item}=$defaultshash{'coursedefaults'}{$item};  
                     }  
                 }                  }
                 if ($changes{'coursecredits'}) {                  if ($changes{'coursecredits'}) {
                     if (ref($defaultshash{'coursedefaults'}{'coursecredits'}) eq 'HASH') {                      if (ref($defaultshash{'coursedefaults'}{'coursecredits'}) eq 'HASH') {
                         foreach my $type (keys(%{$defaultshash{'coursedefaults'}{'coursecredits'}})) {                          $domdefaults{'officialcredits'} =
                             $domdefaults{$type.'credits'} =                              $defaultshash{'coursedefaults'}{'coursecredits'}{'official'};
                                 $defaultshash{'coursedefaults'}{'coursecredits'}{$type};                          $domdefaults{'unofficialcredits'} =
                         }                              $defaultshash{'coursedefaults'}{'coursecredits'}{'unofficial'};
                     }                          $domdefaults{'textbookcredits'} =
                 }                              $domdefaults{'coursedefaults'}{'coursecredits'}{'textbook'};
                 if ($changes{'postsubmit'}) {  
                     if (ref($defaultshash{'coursedefaults'}{'postsubmit'}) eq 'HASH') {  
                         $domdefaults{'postsubmit'} = $defaultshash{'coursedefaults'}{'postsubmit'}{'client'};  
                         if (ref($defaultshash{'coursedefaults'}{'postsubmit'}{'timeout'}) eq 'HASH') {  
                             foreach my $type (keys(%{$defaultshash{'coursedefaults'}{'postsubmit'}{'timeout'}})) {  
                                 $domdefaults{$type.'postsubtimeout'} =  
                                     $defaultshash{'coursedefaults'}{'postsubmit'}{'timeout'}{$type};  
                             }  
                         }  
                     }                      }
                 }                  }
                 if ($changes{'uploadquota'}) {                  if ($changes{'uploadquota'}) {
Line 10405  sub modify_coursedefaults { Line 10117  sub modify_coursedefaults {
             }              }
             $resulttext = &mt('Changes made:').'<ul>';              $resulttext = &mt('Changes made:').'<ul>';
             foreach my $item (sort(keys(%changes))) {              foreach my $item (sort(keys(%changes))) {
                 if ($item eq 'uselcmath') {                  if ($item eq 'canuse_pdfforms') {
                     if ($env{'form.'.$item} eq '1') {                      if ($env{'form.'.$item} eq '1') {
                         $resulttext .= '<li>'.&mt('Math preview uses LON-CAPA previewer (javascript), if supported by browser.').'</li>';                          $resulttext .= '<li>'.&mt("Course/Community users can create/upload PDF forms set to 'on'").'</li>';
                     } else {                      } else {
                         $resulttext .= '<li>'.&mt('Math preview uses DragMath (Java), if supported by client OS.').'</li>';                          $resulttext .= '<li>'.&mt('Course/Community users can create/upload PDF forms set to "off"').'</li>';
                     }  
                 } elsif ($item eq 'usejsme') {  
                     if ($env{'form.'.$item} eq '1') {  
                         $resulttext .= '<li>'.&mt('Molecule editor uses JSME (HTML5), if supported by browser.').'</li>';  
                     } else {  
                         $resulttext .= '<li>'.&mt('Molecule editor uses JME (Java), if supported by client OS.').'</li>';  
                     }                      }
                 } elsif ($item eq 'anonsurvey_threshold') {                  } elsif ($item eq 'anonsurvey_threshold') {
                     $resulttext .= '<li>'.&mt('Responder count required for display of anonymous survey submissions set to [_1].',$defaultshash{'coursedefaults'}{'anonsurvey_threshold'}).'</li>';                      $resulttext .= '<li>'.&mt('Responder count required for display of anonymous survey submissions set to [_1].',$defaultshash{'coursedefaults'}{'anonsurvey_threshold'}).'</li>';
Line 10432  sub modify_coursedefaults { Line 10138  sub modify_coursedefaults {
                     } else {                      } else {
                         $resulttext .= '<li>'.&mt('Default quota for content uploaded via Course Editor remains default: [_1] MB',$staticdefaults{'uploadquota'}).'</li>';                          $resulttext .= '<li>'.&mt('Default quota for content uploaded via Course Editor remains default: [_1] MB',$staticdefaults{'uploadquota'}).'</li>';
                     }                      }
                 } elsif ($item eq 'postsubmit') {  
                     if ($domdefaults{'postsubmit'} eq 'off') {  
                         $resulttext .= '<li>'.&mt('Submit button(s) remain enabled on page after student makes submission.');  
                     } else {  
                         $resulttext .= '<li>'.&mt('Submit button(s) disabled on page after student makes submission').'; ';  
                         if (ref($defaultshash{'coursedefaults'}{'postsubmit'}) eq 'HASH') {  
                             $resulttext .= &mt('durations:').'<ul>';  
                             foreach my $type (@types) {  
                                 $resulttext .= '<li>';  
                                 my $timeout;  
                                 if (ref($defaultshash{'coursedefaults'}{'postsubmit'}{'timeout'}) eq 'HASH') {  
                                     $timeout = $defaultshash{'coursedefaults'}{'postsubmit'}{'timeout'}{$type};  
                                 }  
                                 my $display;  
                                 if ($timeout eq '0') {  
                                     $display = &mt('unlimited');  
                                 } elsif ($timeout eq '') {  
                                     $display = &mt('[quant,_1,second] (default)',$staticdefaults{'postsubmit'});  
                                 } else {  
                                     $display = &mt('[quant,_1,second]',$timeout);  
                                 }  
                                 if ($type eq 'community') {  
                                     $resulttext .= &mt('Communities');  
                                 } elsif ($type eq 'official') {  
                                     $resulttext .= &mt('Official courses');  
                                 } elsif ($type eq 'unofficial') {  
                                     $resulttext .= &mt('Unofficial courses');  
                                 } elsif ($type eq 'textbook') {  
                                     $resulttext .= &mt('Textbook courses');  
                                 }  
                                 $resulttext .= ' -- '.$display.'</li>';  
                             }  
                             $resulttext .= '</ul>';  
                         }  
                         $resulttext .= '</li>';  
                     }  
                 } elsif ($item eq 'coursecredits') {                  } elsif ($item eq 'coursecredits') {
                     if (ref($defaultshash{'coursedefaults'}{'coursecredits'}) eq 'HASH') {                      if (ref($defaultshash{'coursedefaults'}{'coursecredits'}) eq 'HASH') {
                         if (($domdefaults{'officialcredits'} eq '') &&                          if (($domdefaults{'officialcredits'} eq '') &&
Line 11109  sub modify_loadbalancing { Line 10779  sub modify_loadbalancing {
                     $rule = $env{'form.loadbalancing_rules_'.$i.'_'.$type};                      $rule = $env{'form.loadbalancing_rules_'.$i.'_'.$type};
                 }                  }
                 if ($rule eq 'specific') {                  if ($rule eq 'specific') {
                     my $specifiedhost = $env{'form.loadbalancing_singleserver_'.$i.'_'.$type};                      $rule = $env{'form.loadbalancing_singleserver_'.$i.'_'.$type};
                     if (exists($servers{$specifiedhost})) {  
                         $rule = $specifiedhost;  
                     }  
                 }                  }
                 $defaultshash{'loadbalancing'}{$balancer}{'rules'}{$type} = $rule;                  $defaultshash{'loadbalancing'}{$balancer}{'rules'}{$type} = $rule;
                 if (ref($currrules{$balancer}) eq 'HASH') {                  if (ref($currrules{$balancer}) eq 'HASH') {
Line 11186  sub modify_loadbalancing { Line 10853  sub modify_loadbalancing {
                                         if ($rule eq '') {                                          if ($rule eq '') {
                                             $balancetext =  $ruletitles{'default'};                                              $balancetext =  $ruletitles{'default'};
                                         } elsif (($rule eq 'homeserver') || ($rule eq 'externalbalancer') ||                                          } elsif (($rule eq 'homeserver') || ($rule eq 'externalbalancer') ||
                                                  ($type eq '_LC_ipchange') || ($type eq '_LC_ipchangesso')) {                                                   ($type eq '_LC_ipchange') || ($type eq '_LC_ipchangesso')) { 
                                             if (($type eq '_LC_ipchange') || ($type eq '_LC_ipchangesso')) {                                              if (($type eq '_LC_ipchange') || ($type eq '_LC_ipchangesso')) {
                                                 foreach my $sparetype (@sparestypes) {                                                  foreach my $sparetype (@sparestypes) {
                                                     if (ref($defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype}) eq 'ARRAY') {                                                      if (ref($defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype}) eq 'ARRAY') {
Line 11944  function toggleDisplay(domForm,caller) { Line 11611  function toggleDisplay(domForm,caller) {
         if (caller == 'emailoptions') {          if (caller == 'emailoptions') {
             optionsElement = domForm.cancreate_email;               optionsElement = domForm.cancreate_email; 
         }          }
         if (caller == 'studentsubmission') {  
             optionsElement = domForm.postsubmit;  
         }  
         if (optionsElement.length) {          if (optionsElement.length) {
             var currval;              var currval;
             for (var i=0; i<optionsElement.length; i++) {              for (var i=0; i<optionsElement.length; i++) {

Removed from v.1.160.6.57  
changed lines
  Added in v.1.254


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