[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 27 Oct 2004 18:23:09 -0000


albertel		Wed Oct 27 14:23:09 2004 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - less prone to misuse by putting the call to eval state here
  
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.554 loncom/lonnet/perl/lonnet.pm:1.555
--- loncom/lonnet/perl/lonnet.pm:1.554	Tue Oct 26 13:20:09 2004
+++ loncom/lonnet/perl/lonnet.pm	Wed Oct 27 14:23:08 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.554 2004/10/26 17:20:09 www Exp $
+# $Id: lonnet.pm,v 1.555 2004/10/27 18:23:08 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3058,9 +3058,6 @@
             return ''; 
          }
       }
-      if (!defined($ENV{'user.state.'.$ENV{'request.course.id'}})) {
-	  &Apache::lonuserstate::evalstate();
-      }
       if (&condval($statecond)) {
 	 return '2';
       } else {
@@ -3876,6 +3873,9 @@
 
 sub directcondval {
     my $number=shift;
+    if (!defined($ENV{'user.state.'.$ENV{'request.course.id'}})) {
+	&Apache::lonuserstate::evalstate();
+    }
     if ($ENV{'user.state.'.$ENV{'request.course.id'}}) {
        return substr($ENV{'user.state.'.$ENV{'request.course.id'}},$number,1);
     } else {