';
}
if ($symb) {
@@ -2661,7 +2692,7 @@ sub resource_info_box {
} else {
$return='
'.&mt('No context provided.').'
';
}
- if ($stuvcurrent ne '') {
+ if (($stuvcurrent ne '') || ($divforres)) {
$return .= '
';
}
return $return;
@@ -3478,7 +3509,16 @@ function go(url) {
currentURL = null;
currentSymb= null;
var lcHostname = setLCHost();
- window.location.href=lcHostname+url;
+ if (lcHostname!='' && lcHostname!= null) {
+ var RegExp = /^https?\:/;
+ if (RegExp.test(url)) {
+ window.location.href=url;
+ } else {
+ window.location.href=lcHostname+url;
+ }
+ } else {
+ window.location.href=url;
+ }
}
}
@@ -3518,13 +3558,15 @@ sub jump_to_editres {
}
} else {
unless ($cfile =~ m{^/priv/}) {
- if ($cfile =~ m{^(/adm/wrapper/ext/([^#]+))#([^#]+)$}) {
+ if ($cfile =~ m{^(/adm/wrapper/ext/([^#]+))(?:|#([^#]+))$}) {
$cfile = $1;
my $extlink = $2;
$anchor = $3;
$is_ext = 1;
if (($extlink !~ /^https:/) && ($ENV{'SERVER_PORT'} == 443)) {
- $usehttp = 1;
+ unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl($hostname))) {
+ $usehttp = 1;
+ }
} elsif ($env{'request.use_absolute'}) {
if ($env{'request.use_absolute'} =~ m{^https://}) {
$usehttps = 1;
@@ -3537,7 +3579,9 @@ sub jump_to_editres {
($env{'course.'.$env{'request.course.id'}.'.num'} eq $cnum) &&
($env{'course.'.$env{'request.course.id'}.'.domain'} eq $cdom)) {
if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://}) {
- $usehttp = 1;
+ unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl($hostname))) {
+ $usehttp = 1;
+ }
}
}
} elsif ($env{'request.use_absolute'}) {
@@ -3577,9 +3621,7 @@ sub jump_to_editres {
if ($hostname ne '') {
$cfile = 'http://'.$hostname.(($cfile =~ /^\//)? '':'/').$cfile;
}
- unless ($is_ext) {
- $cfile .= (($cfile=~/\?/)?'&':'?').'usehttp=1';
- }
+ $cfile .= (($cfile=~/\?/)?'&':'?').'usehttp=1';
} elsif ($usehttps) {
$cfile = $env{'request.use_absolute'}.(($cfile =~ /^\//)? '':'/').$cfile;
}
@@ -3608,15 +3650,18 @@ sub jump_to_editres {
# javascript_valid_email
#
# Generates javascript to validate an e-mail address.
-# Returns a javascript function which accetps a form field as argumnent, and
+# Returns a javascript function which accepts a form field as argument, and
# returns false if field.value does not satisfy two regular expression matches
# for a valid e-mail address. Backwards compatible with old browsers without
# support for javascript RegExp (just checks for @ in field.value in this case).
sub javascript_valid_email {
my $scripttag .= <<'END';
-function validmail(field) {
+function validmail(field,suffix) {
var str = field.value;
+ if (suffix != '' && suffix != undefined) {
+ str += suffix;
+ }
if (window.RegExp) {
var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"; //"