Diff for /loncom/interface/domainprefs.pm between versions 1.160.6.118.2.8 and 1.160.6.118.2.9

version 1.160.6.118.2.8, 2022/02/27 02:54:35 version 1.160.6.118.2.9, 2022/08/30 20:03:05
Line 1471  sub print_login { Line 1471  sub print_login {
                       '<table><tr><th>'.$choices{'hostid'}.'</th>'.                        '<table><tr><th>'.$choices{'hostid'}.'</th>'.
                       '<th>'.$choices{'samllanding'}.'</th>'.                        '<th>'.$choices{'samllanding'}.'</th>'.
                       '<th>'.$choices{'samloptions'}.'</th></tr>'."\n";                        '<th>'.$choices{'samloptions'}.'</th></tr>'."\n";
         my (%saml,%samltext,%samlimg,%samlalt,%samlurl,%samltitle,%samlnotsso,%styleon,%styleoff);          my (%saml,%samltext,%samlimg,%samlalt,%samlurl,%samltitle,%samlwindow,%samlnotsso,%styleon,%styleoff);
         foreach my $lonhost (keys(%domservers)) {          foreach my $lonhost (keys(%domservers)) {
             $samlurl{$lonhost} = '/adm/sso';              $samlurl{$lonhost} = '/adm/sso';
             $styleon{$lonhost} = 'display:none';              $styleon{$lonhost} = 'display:none';
Line 1486  sub print_login { Line 1486  sub print_login {
                     $samlalt{$lonhost} = $settings->{'saml'}{$lonhost}{'alt'};                      $samlalt{$lonhost} = $settings->{'saml'}{$lonhost}{'alt'};
                     $samlurl{$lonhost} = $settings->{'saml'}{$lonhost}{'url'};                      $samlurl{$lonhost} = $settings->{'saml'}{$lonhost}{'url'};
                     $samltitle{$lonhost} = $settings->{'saml'}{$lonhost}{'title'};                      $samltitle{$lonhost} = $settings->{'saml'}{$lonhost}{'title'};
                       $samlwindow{$lonhost} = $settings->{'saml'}{$lonhost}{'window'};
                     $samlnotsso{$lonhost} = $settings->{'saml'}{$lonhost}{'notsso'};                      $samlnotsso{$lonhost} = $settings->{'saml'}{$lonhost}{'notsso'};
                     $styleon{$lonhost} = '';                      $styleon{$lonhost} = '';
                     $styleoff{$lonhost} = 'display:none';                      $styleoff{$lonhost} = 'display:none';
Line 1503  sub print_login { Line 1504  sub print_login {
                 $samlon = $samloff;                  $samlon = $samloff;
                 $samloff = ' ';                  $samloff = ' ';
             }              }
               my $samlwinon = '';
               my $samlwinoff = ' checked="checked"';
               if ($samlwindow{$lonhost}) {
                   $samlwinon = $samlwinoff;
                   $samlwinoff = '';
               }
             my $css_class = $itemcount%2?' class="LC_odd_row"':'';              my $css_class = $itemcount%2?' class="LC_odd_row"':'';
             $datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'.$domservers{$lonhost}.'</span></td>'.              $datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'.$domservers{$lonhost}.'</span></td>'.
                           '<td><span class="LC_nobreak"><label><input type="radio" name="saml_'.$lonhost.'"'.$samloff.                            '<td><span class="LC_nobreak"><label><input type="radio" name="saml_'.$lonhost.'"'.$samloff.
Line 1512  sub print_login { Line 1519  sub print_login {
                           'onclick="toggleSamlOptions(this.form,'."'$lonhost'".');" value="1" />'.                            'onclick="toggleSamlOptions(this.form,'."'$lonhost'".');" value="1" />'.
                           &mt('Yes').'</label></span></td>'.                            &mt('Yes').'</label></span></td>'.
                           '<td id="samloptionson_'.$lonhost.'" style="'.$styleon{$lonhost}.'" width="100%">'.                            '<td id="samloptionson_'.$lonhost.'" style="'.$styleon{$lonhost}.'" width="100%">'.
                           '<table><tr><th colspan="5" align="center">'.&mt('SSO').'</th><th align="center">'.                            '<table width="100%"><tr><th colspan="3" align="center">'.&mt('SSO').'</th></tr>'.
                           '<span class="LC_nobreak">'.&mt('Non-SSO').'</span></th></tr>'.  
                           '<tr><th>'.&mt('Text').'</th><th>'.&mt('Image').'</th>'.                            '<tr><th>'.&mt('Text').'</th><th>'.&mt('Image').'</th>'.
                           '<th>'.&mt('Alt Text').'</th><th>'.&mt('URL').'</th>'.                            '<th>'.&mt('Alt Text').'</th></tr>'.
                           '<th>'.&mt('Tool Tip').'</th><th>'.&mt('Text').'</th></tr>'.                            '<tr'.$css_class.'><td><input type="text" name="saml_text_'.$lonhost.'" size="20" value="'.
                           '<tr'.$css_class.'><td><input type="text" name="saml_text_'.$lonhost.'" size="8" value="'.  
                           $samltext{$lonhost}.'" /></td><td>';                            $samltext{$lonhost}.'" /></td><td>';
             if ($samlimg{$lonhost}) {              if ($samlimg{$lonhost}) {
                 $datatable .= '<img src="'.$samlimg{$lonhost}.'" /><br />'.                  $datatable .= '<img src="'.$samlimg{$lonhost}.'" /><br />'.
Line 1534  sub print_login { Line 1539  sub print_login {
                 $datatable .= '<input type="file" name="saml_img_'.$lonhost.'" />';                  $datatable .= '<input type="file" name="saml_img_'.$lonhost.'" />';
             }              }
             $datatable .= '</td>'.              $datatable .= '</td>'.
                           '<td><input type="text" name="saml_alt_'.$lonhost.'" size="20" '.                            '<td><input type="text" name="saml_alt_'.$lonhost.'" size="25" '.
                           'value="'.$samlalt{$lonhost}.'" /></td>'.                            'value="'.$samlalt{$lonhost}.'" /></td></tr></table><br />'.
                           '<td><input type="text" name="saml_url_'.$lonhost.'" size="8" '.                            '<table width="100%"><tr><th colspan="3" align="center">'.&mt('SSO').'</th><th align="center">'.
                             '<span class="LC_nobreak">'.&mt('Non-SSO').'</span></th></tr>'.
                             '<tr><th>'.&mt('URL').'</th><th>'.&mt('Tool Tip').'</th>'.
                             '<th>'.&mt('Pop-up if iframe').'</th><th>'.&mt('Text').'</th></tr>'.
                             '<tr'.$css_class.'>'.
                             '<td><input type="text" name="saml_url_'.$lonhost.'" size="30" '.
                           'value="'.$samlurl{$lonhost}.'" /></td>'.                            'value="'.$samlurl{$lonhost}.'" /></td>'.
                           '<td><textarea name="saml_title_'.$lonhost.'" rows="3" cols="15">'.                            '<td><textarea name="saml_title_'.$lonhost.'" rows="3" cols="20">'.
                           $samltitle{$lonhost}.'</textarea></td>'.                            $samltitle{$lonhost}.'</textarea></td>'.
                           '<td><input type="text" name="saml_notsso_'.$lonhost.'" size="8" '.                            '<td><label><input type="radio" name="saml_window_'.$lonhost.'" value=""'.$samlwinoff.'>'.
                             &mt('No').'</label>'.('&nbsp;'x2).'<label><input type="radio" '.
                             'name="saml_window_'.$lonhost.'" value="1"'.$samlwinon.'>'.&mt('Yes').'</label></td>'.
                             '<td><input type="text" name="saml_notsso_'.$lonhost.'" size="12" '.
                           'value="'.$samlnotsso{$lonhost}.'" /></td></tr>'.                            'value="'.$samlnotsso{$lonhost}.'" /></td></tr>'.
                           '</table></td>'.                            '</table></td>'.
                           '<td id="samloptionsoff_'.$lonhost.'" style="'.$styleoff{$lonhost}.'" width="100%">&nbsp;</td></tr>';                            '<td id="samloptionsoff_'.$lonhost.'" style="'.$styleoff{$lonhost}.'" width="100%">&nbsp;</td></tr>';
Line 10004  sub modify_login { Line 10017  sub modify_login {
     my ($r,$dom,$confname,$lastactref,%domconfig) = @_;      my ($r,$dom,$confname,$lastactref,%domconfig) = @_;
     my ($resulttext,$errors,$colchgtext,%changes,%colchanges,%newfile,%newurl,      my ($resulttext,$errors,$colchgtext,%changes,%colchanges,%newfile,%newurl,
         %curr_loginvia,%loginhash,@currlangs,@newlangs,$addedfile,%title,@offon,          %curr_loginvia,%loginhash,@currlangs,@newlangs,$addedfile,%title,@offon,
         %currsaml,%saml,%samltext,%samlimg,%samlalt,%samlurl,%samltitle,%samlnotsso);          %currsaml,%saml,%samltext,%samlimg,%samlalt,%samlurl,%samltitle,%samlwindow,%samlnotsso);
     %title = ( coursecatalog => 'Display course catalog',      %title = ( coursecatalog => 'Display course catalog',
                adminmail => 'Display administrator E-mail address',                 adminmail => 'Display administrator E-mail address',
                helpdesk  => 'Display "Contact Helpdesk" link',                 helpdesk  => 'Display "Contact Helpdesk" link',
Line 10028  sub modify_login { Line 10041  sub modify_login {
                     $samlalt{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'alt'};                      $samlalt{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'alt'};
                     $samlimg{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'img'};                      $samlimg{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'img'};
                     $samltitle{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'title'};                      $samltitle{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'title'};
                       $samlwindow{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'window'};
                     $samlnotsso{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'notsso'};                      $samlnotsso{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'notsso'};
                 }                  }
             }              }
Line 10285  sub modify_login { Line 10299  sub modify_login {
             if ($env{'form.saml_img_'.$lonhost.'.filename'}) {              if ($env{'form.saml_img_'.$lonhost.'.filename'}) {
                 push(@newsamlimgs,$lonhost);                  push(@newsamlimgs,$lonhost);
             }              }
             foreach my $item ('text','alt','url','title','notsso') {              foreach my $item ('text','alt','url','title','window','notsso') {
                 $env{'form.saml_'.$item.'_'.$lonhost} =~ s/^\s+|\s+$//g;                  $env{'form.saml_'.$item.'_'.$lonhost} =~ s/^\s+|\s+$//g;
             }              }
             if ($saml{$lonhost}) {              if ($saml{$lonhost}) {
                   if ($env{'form.saml_window_'.$lonhost} ne '1') {
                       $env{'form.saml_window_'.$lonhost} = '';
                   }
                 if (grep(/^\Q$lonhost\E$/,@delsamlimg)) {                  if (grep(/^\Q$lonhost\E$/,@delsamlimg)) {
 #FIXME Need to obsolete published image  #FIXME Need to obsolete published image
                     delete($currsaml{$lonhost}{'img'});                      delete($currsaml{$lonhost}{'img'});
Line 10306  sub modify_login { Line 10323  sub modify_login {
                 if ($env{'form.saml_title_'.$lonhost} ne $samltitle{$lonhost}) {                  if ($env{'form.saml_title_'.$lonhost} ne $samltitle{$lonhost}) {
                     $changes{'saml'}{$lonhost} = 1;                      $changes{'saml'}{$lonhost} = 1;
                 }                  }
                   if ($env{'form.saml_window_'.$lonhost} ne $samlwindow{$lonhost}) {
                       $changes{'saml'}{$lonhost} = 1;
                   }
                 if ($env{'form.saml_notsso_'.$lonhost} ne $samlnotsso{$lonhost}) {                  if ($env{'form.saml_notsso_'.$lonhost} ne $samlnotsso{$lonhost}) {
                     $changes{'saml'}{$lonhost} = 1;                      $changes{'saml'}{$lonhost} = 1;
                 }                  }
             } else {              } else {
                 $changes{'saml'}{$lonhost} = 1;                  $changes{'saml'}{$lonhost} = 1;
             }              }
             foreach my $item ('text','alt','url','title','notsso') {              foreach my $item ('text','alt','url','title','window','notsso') {
                 $currsaml{$lonhost}{$item} = $env{'form.saml_'.$item.'_'.$lonhost};                  $currsaml{$lonhost}{$item} = $env{'form.saml_'.$item.'_'.$lonhost};
             }              }
         } else {          } else {
Line 10513  sub modify_login { Line 10533  sub modify_login {
                                        alt    => 'Alt text for button image',                                         alt    => 'Alt text for button image',
                                        url    => 'SSO URL',                                         url    => 'SSO URL',
                                        title  => 'Tooltip for SSO link',                                         title  => 'Tooltip for SSO link',
                                          window => 'Pop-up window if iframe',
                                        notsso => 'Text for non-SSO log-in',                                         notsso => 'Text for non-SSO log-in',
                                     );                                      );
                         foreach my $lonhost (sort(keys(%{$changes{$item}}))) {                          foreach my $lonhost (sort(keys(%{$changes{$item}}))) {
                             if (ref($currsaml{$lonhost}) eq 'HASH') {                              if (ref($currsaml{$lonhost}) eq 'HASH') {
                                 $resulttext .= '<li>'.&mt("$title{$item} in use for [_1]","<b>$lonhost</b>").                                  $resulttext .= '<li>'.&mt("$title{$item} in use for [_1]","<b>$lonhost</b>").
                                                '<ul>';                                                 '<ul>';
                                 foreach my $key ('text','img','alt','url','title','notsso') {                                  foreach my $key ('text','img','alt','url','title','window','notsso') {
                                     if ($currsaml{$lonhost}{$key} eq '') {                                      if ($currsaml{$lonhost}{$key} eq '') {
                                         $resulttext .= '<li>'.&mt("$notlt{$key} not in use").'</li>';                                          $resulttext .= '<li>'.&mt("$notlt{$key} not in use").'</li>';
                                     } else {                                      } else {
                                         my $value = "'$currsaml{$lonhost}{$key}'";                                          my $value = "'$currsaml{$lonhost}{$key}'";
                                         if ($key eq 'img') {                                          if ($key eq 'img') {
                                             $value = '<img src="'.$currsaml{$lonhost}{$key}.'" />';                                              $value = '<img src="'.$currsaml{$lonhost}{$key}.'" />';
                                           } elsif ($key eq 'window') {
                                               $value = 'On';
                                         }                                          }
                                         $resulttext .= '<li>'.&mt("$notlt{$key} set to: [_1]",                                          $resulttext .= '<li>'.&mt("$notlt{$key} set to: [_1]",
                                                                   $value).'</li>';                                                                    $value).'</li>';

Removed from v.1.160.6.118.2.8  
changed lines
  Added in v.1.160.6.118.2.9


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