--- loncom/interface/lonhtmlcommon.pm 2017/02/18 23:39:16 1.380
+++ loncom/interface/lonhtmlcommon.pm 2017/02/20 18:29:22 1.381
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.380 2017/02/18 23:39:16 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.381 2017/02/20 18:29:22 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3496,8 +3496,8 @@ ENDUTILITY
sub jump_to_editres {
my ($cfile,$home,$switchserver,$forceedit,$forcereg,$symb,$folderpath,
- $title,$idx,$suppurl,$todocs,$suppanchor) = @_;
- my ($jscall,$anchor,$usehttp);
+ $title,$hostname,$idx,$suppurl,$todocs,$suppanchor) = @_;
+ my ($jscall,$anchor,$usehttp,$usehttps);
if ($switchserver) {
if ($home) {
$cfile = '/adm/switchserver?otherserver='.$home.'&role='.
@@ -3530,6 +3530,10 @@ sub jump_to_editres {
$usehttp = 1;
}
}
+ } elsif ($env{'request.use_absolute'}) {
+ if ($env{'request.use_absolute'} =~ m{^https://}) {
+ $usehttps = 1;
+ }
}
}
if ($symb) {
@@ -3556,7 +3560,13 @@ sub jump_to_editres {
}
if ($forceedit) {
$cfile .= (($cfile=~/\?/)?'&':'?').'forceedit=1';
+ if (($usehttps) && ($hostname ne '')) {
+ $cfile = 'https://'.$hostname.$cfile;
+ }
} elsif ($usehttp) {
+ if ($hostname ne '') {
+ $cfile = 'http://'.$hostname.$cfile;
+ }
$cfile .= (($cfile=~/\?/)?'&':'?').'usehttp=1';
}
if ($forcereg) {