Diff for /loncom/interface/lonsyllabus.pm between versions 1.138.2.5.2.1 and 1.138.2.5.2.2

version 1.138.2.5.2.1, 2020/01/14 01:04:39 version 1.138.2.5.2.2, 2020/01/20 17:21:08
Line 185  sub handler { Line 185  sub handler {
         }          }
     } elsif ($external=~/\w/) {      } elsif ($external=~/\w/) {
         unless ($allowed && $forceedit) {          unless ($allowed && $forceedit) {
               if (($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public') &&
                   ($ENV{'SERVER_PORT'} == 443) && ($external =~ m{^http://}) && !($env{'form.usehttp'})) {
                   unless (&Apache::lonnet::uses_sts()) {
                       &redirect_to_http($r);
                       return OK;
                   }
               }
             if ($target eq 'tex') {              if ($target eq 'tex') {
                 $r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'}).                  $r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'}).
                          ' \strut \\\\ \textbf{'.&mt('Syllabus').'} \strut \\\\ '.$external.' '.                           ' \strut \\\\ \textbf{'.&mt('Syllabus').'} \strut \\\\ '.$external.' '.
Line 309  sub handler { Line 316  sub handler {
             my $hostname = &Apache::lonnet::hostname($homeserver);              my $hostname = &Apache::lonnet::hostname($homeserver);
             my $protocol = $Apache::lonnet::protocol{$homeserver};              my $protocol = $Apache::lonnet::protocol{$homeserver};
             $protocol = 'http' if ($protocol ne 'https');              $protocol = 'http' if ($protocol ne 'https');
             my $link = $r->uri;              my $link = $protocol.'://'.$hostname.$r->uri;
             if (($protocol eq 'https') && ($external =~ m{^http://})) {  
                 unless (&Apache::lonnet::uses_sts()) {  
                     $link .= '?usehttp=1';  
                     $protocol = 'http';  
                 }  
             }  
             $link = $protocol.'://'.$hostname.$link;  
             $r->print('<div class="LC_left_float">'              $r->print('<div class="LC_left_float">'
                      .'<span class="LC_help_open_topic LC_info">'                       .'<span class="LC_help_open_topic LC_info">'
                      .'<span class="LC_info">'                       .'<span class="LC_info">'
Line 1721  sub editbutton_js { Line 1721  sub editbutton_js {
 ENDJS  ENDJS
 }  }
   
   sub redirect_to_http {
       my ($r) = @_;
       &Apache::loncommon::content_type($r,'text/html');
       &Apache::loncommon::no_cache($r);
       $r->send_http_header;
       my $url = 'http://'.$r->hostname().$r->uri().'?usehttp=1';
       $r->print(&Apache::loncommon::start_page(undef,undef,
                                                {'redirect' => [0,$url],}).
                 &Apache::loncommon::end_page());
       return;
   }
   
 1;  1;
 __END__  __END__

Removed from v.1.138.2.5.2.1  
changed lines
  Added in v.1.138.2.5.2.2


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