Diff for /loncom/interface/londocs.pm between versions 1.677 and 1.680

version 1.677, 2021/04/23 01:37:14 version 1.680, 2022/09/13 13:54:02
Line 3968  sub entryline { Line 3968  sub entryline {
     my $line=&Apache::loncommon::start_data_table_row();      my $line=&Apache::loncommon::start_data_table_row();
     my ($form_start,$form_end,$form_common,$form_param);      my ($form_start,$form_end,$form_common,$form_param);
 # Edit commands  # Edit commands
     my ($esc_path, $path, $symb, $curralias);      my ($esc_path, $path, $symb, $shownsymb, $curralias);
     if ($env{'form.folderpath'}) {      if ($env{'form.folderpath'}) {
  $esc_path=&escape($env{'form.folderpath'});   $esc_path=&escape($env{'form.folderpath'});
  $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');   $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
Line 4235  END Line 4235  END
             } elsif ($url eq "/public/$coursedom/$coursenum/syllabus") {              } elsif ($url eq "/public/$coursedom/$coursenum/syllabus") {
                 if (($ENV{'SERVER_PORT'} == 443) &&                  if (($ENV{'SERVER_PORT'} == 443) &&
                     ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {                      ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {
                     unless (&Apache::lonnet::uses_sts()) {                      unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl($hostname))) {
                         $url .= '?usehttp=1';                          $url .= '?usehttp=1';
                     }                      }
                     $nomodal = 1;                      $nomodal = 1;
                 }                  }
             }              }
             if (&Apache::lonnet::symbverify($symb,$url)) {              my ($checkencrypt,$shownurl);
                 my $shownsymb = $symb;              if (!$env{'request.role.adv'}) {
                 if ($isexternal) {  
                     $url =~ s/\#[^#]+$//;  
                     if ($container eq 'page') {  
                         $url = &Apache::lonnet::clutter($url);  
                     }  
                 }  
                 unless ($env{'request.role.adv'}) {  
                     if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) {  
                         $url = '';  
                     }  
                     if (&Apache::lonnet::EXT('resource.0.hiddenresource',$symb) =~ /^yes$/i) {  
                         $url = '';  
                         $hiddenres = 1;  
                     }  
                 }  
                 if ($url ne '') {  
                     $url.=(($url=~/\?/)?'&':'?').'symb='.&escape($shownsymb);  
                 }  
             } elsif (!$env{'request.role.adv'}) {  
                 my $checkencrypt;  
                 if (((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i) ||                  if (((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i) ||
                       $isencrypted || (&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i)) {                      ($isencrypted) || (&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i)) {
                     $checkencrypt = 1;                      $checkencrypt = 1;
                 } elsif (ref($navmapref)) {                  } elsif (ref($navmapref)) {
                     unless (ref($$navmapref)) {                      unless (ref($$navmapref)) {
Line 4272  END Line 4252  END
                     }                      }
                     if (ref($$navmapref)) {                      if (ref($$navmapref)) {
                         if (lc($$navmapref->get_mapparam($symb,undef,"0.encrypturl")) eq 'yes') {                          if (lc($$navmapref->get_mapparam($symb,undef,"0.encrypturl")) eq 'yes') {
                             $checkencrypt = 1;                                     $checkencrypt = 1;
                         }                          }
                     }                      }
                 }                  }
                 if ($checkencrypt) {              }
                     my $shownsymb = &Apache::lonenc::encrypted($symb);              if ($checkencrypt) {
                     my $shownurl = &Apache::lonenc::encrypted($url);                  my $currenc = $env{'request.enc'};
                     if (&Apache::lonnet::symbverify($shownsymb,$shownurl)) {                  $env{'request.enc'} = 1;
                         $url = $shownurl.(($shownurl=~/\?/)?'&':'?').'symb='.&escape($shownsymb);                  $shownsymb = &Apache::lonenc::encrypted($symb);
                         if ($env{'request.enc'} ne '') {                  $shownurl = &Apache::lonenc::encrypted($url);
                             delete($env{'request.enc'});                  if (&Apache::lonnet::symbverify($symb,$url)) {
                         }                      $url = $shownurl;
                     } else {  
                         $url='';  
                     }  
                 } else {                  } else {
                     $url='';                      $url = '';
                 }                  }
             } else {                  $env{'request.enc'} = $currenc;
                 $url='';              } elsif (&Apache::lonnet::symbverify($symb,$url)) {
                   $shownsymb = $symb;
                   if ($isexternal) {
                       $url =~ s/\#[^#]+$//;
                       if ($container eq 'page') {
                           $url = &Apache::lonnet::clutter($url);
                       }
                   }
                   $shownurl = $url;
               }
               unless ($env{'request.role.adv'}) {
                   if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) {
                       $url = '';
                   }
                   if (&Apache::lonnet::EXT('resource.0.hiddenresource',$symb) =~ /^yes$/i) {
                       $url = '';
                       $hiddenres = 1;
                   }
               }
               if ($url ne '') {
                   $url = $shownurl.(($shownurl=~/\?/)?'&':'?').'symb='.&escape($shownsymb);
             }              }
  }   }
     } elsif ($supplementalflag) {      } elsif ($supplementalflag) {
Line 4300  END Line 4297  END
                 $url = $1;                  $url = $1;
                 $anchor = $2;                  $anchor = $2;
                 if (($url =~ m{^(|/adm/wrapper)/ext/(?!https:)}) && ($ENV{'SERVER_PORT'} == 443)) {                  if (($url =~ m{^(|/adm/wrapper)/ext/(?!https:)}) && ($ENV{'SERVER_PORT'} == 443)) {
                     unless (&Apache::lonnet::uses_sts()) {                      unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl($hostname))) {
                         if ($hostname ne '') {                          if ($hostname ne '') {
                             $url = 'http://'.$hostname.$url;                              $url = 'http://'.$hostname.$url;
                         }                          }
Line 4312  END Line 4309  END
         } elsif ($url =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) {          } elsif ($url =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) {
             if (($ENV{'SERVER_PORT'} == 443) &&              if (($ENV{'SERVER_PORT'} == 443) &&
                 ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {                  ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {
                 unless (&Apache::lonnet::uses_sts()) {                  unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl($hostname))) {
                     if ($hostname ne '') {                      if ($hostname ne '') {
                         $url = 'http://'.$hostname.$url;                          $url = 'http://'.$hostname.$url;
                     }                      }
Line 4451  $form_end; Line 4448  $form_end;
                     &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,                      &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,
                                                             $switchserver,                                                              $switchserver,
                                                             $forceedit,                                                              $forceedit,
                                                             undef,$symb,                                                              undef,$symb,$shownsymb,
                                                             &escape($env{'form.folderpath'}),                                                              &escape($env{'form.folderpath'}),
                                                             $renametitle,$hostname,                                                              $renametitle,$hostname,
                                                             '','',1,$suppanchor);                                                              '','',1,$suppanchor);
Line 7324  sub editing_js { Line 7321  sub editing_js {
                 if ($backtourl =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) {                  if ($backtourl =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) {
                     if (($ENV{'SERVER_PORT'} == 443) &&                      if (($ENV{'SERVER_PORT'} == 443) &&
                         ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {                          ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {
                         unless (&Apache::lonnet::uses_sts()) {                          unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl($hostname))) {
                             if ($hostname ne '') {                              if ($hostname ne '') {
                                 $backtourl = 'http://'.$hostname.$backtourl;                                  $backtourl = 'http://'.$hostname.$backtourl;
                             }                              }
Line 7333  sub editing_js { Line 7330  sub editing_js {
                     }                      }
                 } elsif ($backtourl =~ m{^/adm/wrapper/ext/(?!https:)}) {                  } elsif ($backtourl =~ m{^/adm/wrapper/ext/(?!https:)}) {
                     if (($ENV{'SERVER_PORT'} == 443) && ($hostname ne '')) {                      if (($ENV{'SERVER_PORT'} == 443) && ($hostname ne '')) {
                         unless (&Apache::lonnet::uses_sts()) {                          unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl($hostname))) {
                             if ($hostname ne '') {                              if ($hostname ne '') {
                                 $backtourl = 'http://'.$hostname.$backtourl;                                  $backtourl = 'http://'.$hostname.$backtourl;
                             }                              }

Removed from v.1.677  
changed lines
  Added in v.1.680


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