--- rat/lonuserstate.pm 2005/03/15 19:25:30 1.87 +++ rat/lonuserstate.pm 2005/04/07 06:56:27 1.89 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Construct and maintain state and binary representation of course for user # -# $Id: lonuserstate.pm,v 1.87 2005/03/15 19:25:30 albertel Exp $ +# $Id: lonuserstate.pm,v 1.89 2005/04/07 06:56:27 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,9 +32,8 @@ package Apache::lonuserstate; # ------------------------------------------------- modules used by this module use strict; use Apache::Constants qw(:common :http); -use Apache::File; use HTML::TokeParser; -use Apache::lonnet(); +use Apache::lonnet; use Apache::loncommon(); use GDBM_File; use Apache::lonmsg; @@ -589,7 +588,7 @@ sub readmap { # ---------------------------------------------------- Store away initial state { my $cfh; - if ($cfh=Apache::File->new(">$fn.state")) { + if (open($cfh,">$fn.state")) { print $cfh join("\n",@cond); } else { &Apache::lonnet::logthis("WARNING: ". @@ -625,11 +624,11 @@ sub readmap { untie(%parmhash); } } - &Apache::lonmsg::author_res_msg($ENV{'request.course.uri'},$errtext); + &Apache::lonmsg::author_res_msg($env{'request.course.uri'},$errtext); # ------------------------------------------------- Check for critical messages - my @what=&Apache::lonnet::dump('critical',$ENV{'user.domain'}, - $ENV{'user.name'}); + my @what=&Apache::lonnet::dump('critical',$env{'user.domain'}, + $env{'user.name'}); if ($what[0]) { if (($what[0] ne 'con_lost') && ($what[0]!~/^error\:/)) { $retfurl='/adm/email?critical=display'; @@ -641,7 +640,7 @@ sub readmap { # ------------------------------------------------------- Evaluate state string sub evalstate { - my $fn=$ENV{'request.course.fn'}.'.state'; + my $fn=$env{'request.course.fn'}.'.state'; my $state=''; if (-e $fn) { my @conditions=(); @@ -673,7 +672,7 @@ sub evalstate { } } } - &Apache::lonnet::appenv('user.state.'.$ENV{'request.course.id'} => $state); + &Apache::lonnet::appenv('user.state.'.$env{'request.course.id'} => $state); return $state; }