[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm /homework lonhomework.pm /interface lonfeedback.pm /lonnet/perl lonnet.pm
www
lon-capa-cvs@mail.lon-capa.org
Mon, 15 Sep 2003 18:43:54 -0000
www Mon Sep 15 14:43:54 2003 EDT
Modified files:
/loncom/auth lonroles.pm
/loncom/homework lonhomework.pm
/loncom/interface lonfeedback.pm
/loncom/lonnet/perl lonnet.pm
Log:
Bug #2190: call to &Apache::exists_config_define is not defined before child
completed another request.
At least things don't crash anymore - found no way of getting around error
messages, neither with eval nor with defined.
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.67 loncom/auth/lonroles.pm:1.68
--- loncom/auth/lonroles.pm:1.67 Thu Sep 11 16:03:28 2003
+++ loncom/auth/lonroles.pm Mon Sep 15 14:43:53 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.67 2003/09/11 20:03:28 albertel Exp $
+# $Id: lonroles.pm,v 1.68 2003/09/15 18:43:53 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -172,9 +172,9 @@
if (($ENV{'form.orgurl'}) &&
($ENV{'form.orgurl'}!~/^\/adm\/flip/)) {
my $dest=$ENV{'form.orgurl'};
- if ( Apache::exists_config_define("MODPERL2") ) {
+
&Apache::lonnet::cleanenv();
- }
+
$r->internal_redirect($dest);
return OK;
} else {
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.140 loncom/homework/lonhomework.pm:1.141
--- loncom/homework/lonhomework.pm:1.140 Thu Sep 11 16:03:28 2003
+++ loncom/homework/lonhomework.pm Mon Sep 15 14:43:53 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Homework handler
#
-# $Id: lonhomework.pm,v 1.140 2003/09/11 20:03:28 albertel Exp $
+# $Id: lonhomework.pm,v 1.141 2003/09/15 18:43:53 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -660,9 +660,9 @@
# if we are browsing we might not be able to know where we are
if ($Apache::lonhomework::browse ne 'F') {
#should know where we are, so ask
- if ( Apache::exists_config_define("MODPERL2") ) {
+
&Apache::lonnet::cleanenv();
- }
+
$request->internal_redirect('/adm/ambiguous'); return;
}
}
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.55 loncom/interface/lonfeedback.pm:1.56
--- loncom/interface/lonfeedback.pm:1.55 Mon Sep 15 09:38:19 2003
+++ loncom/interface/lonfeedback.pm Mon Sep 15 14:43:54 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.55 2003/09/15 13:38:19 www Exp $
+# $Id: lonfeedback.pm,v 1.56 2003/09/15 18:43:54 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -735,9 +735,9 @@
}
} else {
# Ambiguous Problem Resource
- if ( Apache::exists_config_define("MODPERL2") ) {
+
&Apache::lonnet::cleanenv();
- }
+
$r->internal_redirect('/adm/ambiguous');
}
}
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.411 loncom/lonnet/perl/lonnet.pm:1.412
--- loncom/lonnet/perl/lonnet.pm:1.411 Thu Sep 11 03:57:03 2003
+++ loncom/lonnet/perl/lonnet.pm Mon Sep 15 14:43:54 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.411 2003/09/11 07:57:03 albertel Exp $
+# $Id: lonnet.pm,v 1.412 2003/09/15 18:43:54 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -246,9 +246,13 @@
return $answer;
}
+#
# -------------- Remove all key from the env that start witha lowercase letter
-# (Which is alweways a lon-capa value)
+# (Which is always a lon-capa value)
+
sub cleanenv {
+# unless (defined(&Apache::exists_config_define("MODPERL2"))) { return; }
+# unless (&Apache::exists_config_define("MODPERL2")) { return; }
foreach my $key (keys(%ENV)) {
if ($key =~ /^[a-z]/) {
delete($ENV{$key});