--- loncom/interface/londocs.pm	2005/04/04 23:51:54	1.173
+++ loncom/interface/londocs.pm	2005/04/07 06:56:23	1.174
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.173 2005/04/04 23:51:54 albertel Exp $
+# $Id: londocs.pm,v 1.174 2005/04/07 06:56:23 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -86,17 +86,17 @@ sub authorhosts {
     my %outhash=();
     my $home=0;
     my $other=0;
-    foreach (keys %ENV) {
+    foreach (keys %env) {
 	if ($_=~/^user\.role\.(au|ca)\.(.+)$/) {
 	    my $role=$1;
 	    my $realm=$2;
-	    my ($start,$end)=split(/\./,$ENV{$_});
+	    my ($start,$end)=split(/\./,$env{$_});
 	    if (($start) && ($start>time)) { next; }
 	    if (($end) && (time>$end)) { next; }
 	    my $ca; my $cd;
 	    if ($1 eq 'au') {
-		$ca=$ENV{'user.name'};
-		$cd=$ENV{'user.domain'};
+		$ca=$env{'user.name'};
+		$cd=$env{'user.domain'};
 	    } else {
 		($cd,$ca)=($realm=~/^\/(\w+)\/(\w+)$/);
 	    }
@@ -147,22 +147,22 @@ sub dumpcourse {
 	      '<form name="dumpdoc" method="post">');
     my ($home,$other,%outhash)=&authorhosts();
     unless ($home) { return ''; }
-    my $origcrsid=$ENV{'request.course.id'};
+    my $origcrsid=$env{'request.course.id'};
     my %origcrsdata=&Apache::lonnet::coursedescription($origcrsid);
-    if (($ENV{'form.authorspace'}) && ($ENV{'form.authorfolder'}=~/\w/)) {
+    if (($env{'form.authorspace'}) && ($env{'form.authorfolder'}=~/\w/)) {
 # Do the dumping
-	unless ($outhash{'home_'.$ENV{'form.authorspace'}}) { return ''; }
-	my ($ca,$cd)=split(/\@/,$ENV{'form.authorspace'});
+	unless ($outhash{'home_'.$env{'form.authorspace'}}) { return ''; }
+	my ($ca,$cd)=split(/\@/,$env{'form.authorspace'});
 	$r->print('<h3>'.&mt('Copying Files').'</h3>');
-	my $title=$ENV{'form.authorfolder'};
+	my $title=$env{'form.authorfolder'};
 	$title=&clean($title);
 	my %replacehash=();
-	foreach (keys %ENV) {
+	foreach (keys %env) {
 	    if ($_=~/^form\.namefor\_(.+)/) {
-		$replacehash{$1}=$ENV{$_};
+		$replacehash{$1}=$env{$_};
 	    }
 	}
-	my $crs='/uploaded/'.$ENV{'request.course.id'}.'/';
+	my $crs='/uploaded/'.$env{'request.course.id'}.'/';
 	$crs=~s/\_/\//g;
 	foreach (keys %replacehash) {
 	    my $newfilename=$title.'/'.$replacehash{$_};
@@ -181,12 +181,12 @@ sub dumpcourse {
 	    if (my $fh=Apache::File->new('>'.$path.'/'.$newfilename)) {
 		if ($_=~/\.(sequence|page|html|htm|xml|xhtml)$/) {
 		    print $fh &Apache::loncreatecourse::rewritefile(
-         &Apache::loncreatecourse::readfile($ENV{'request.course.id'},$_),
+         &Apache::loncreatecourse::readfile($env{'request.course.id'},$_),
 				     (%replacehash,$crs => '')
 								    );
 		} else {
 		    print $fh
-         &Apache::loncreatecourse::readfile($ENV{'request.course.id'},$_);
+         &Apache::loncreatecourse::readfile($env{'request.course.id'},$_);
 		       }
 		$fh->close();
 	    } else {
@@ -259,7 +259,7 @@ sub exportbutton {
 sub exportcourse {
     my $r=shift;
     my %discussiontime = &Apache::lonnet::dump('discussiontimes',
-                                               $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
+                                               $env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'});
     my $numdisc = keys %discussiontime;
     my $navmap = Apache::lonnavmaps::navmap->new();
     my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef);
@@ -268,24 +268,24 @@ sub exportcourse {
 
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                             ['finishexport']);
-    if ($ENV{'form.finishexport'}) {
+    if ($env{'form.finishexport'}) {
         &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                             ['archive','discussion']);
 
         my @exportitems = ();
-        if (defined($ENV{'form.archive'})) {
-            if (ref($ENV{'form.archive'}) eq 'ARRAY') {
-                @exportitems = @{$ENV{'form.archive'}};
+        if (defined($env{'form.archive'})) {
+            if (ref($env{'form.archive'}) eq 'ARRAY') {
+                @exportitems = @{$env{'form.archive'}};
             } else {
-                $exportitems[0] = $ENV{'form.archive'};
+                $exportitems[0] = $env{'form.archive'};
             }
         }
         my @discussions = ();
-        if (defined($ENV{'form.discussion'})) {
-            if (ref($ENV{'form.discussion'}) eq 'ARRAY') {
-                @discussions = $ENV{'form.discussion'};
+        if (defined($env{'form.discussion'})) {
+            if (ref($env{'form.discussion'}) eq 'ARRAY') {
+                @discussions = $env{'form.discussion'};
             } else {
-                $discussions[0] = $ENV{'form.discussion'};
+                $discussions[0] = $env{'form.discussion'};
             }
         }
         if (@exportitems == 0 && @discussions == 0) {
@@ -304,20 +304,14 @@ sub exportcourse {
 
 #Create zip file in prtspool
                 my $imszipfile = '/prtspool/'.
-                $ENV{'user.name'}.'_'.$ENV{'user.domain'}.'_'.
+                $env{'user.name'}.'_'.$env{'user.domain'}.'_'.
                    time.'_'.rand(1000000000).'.zip';
-# zip can cause an sh launch which can pass along all of %ENV
-# which can be too large for /bin/sh to handle
-                my %oldENV=%ENV;
-                undef(%ENV);
                 my $cwd = &Cwd::getcwd();
                 my $imszip = '/home/httpd/'.$imszipfile;
                 chdir $tempexport;
                 open(OUTPUT, "zip -r $imszip *  2> /dev/null |");
                 close(OUTPUT);
                 chdir $cwd;
-                %ENV=%oldENV;
-                undef(%oldENV);
                 $outcome .= 'Download the zip file from <a href="'.$imszipfile.'">IMS course archive</a><br />';
                 if ($copyresult) {
                     $outcome .= 'The following errors occurred during export - '.$copyresult;
@@ -491,7 +485,7 @@ sub create_ims_store {
     if (!-e $$tempexport) {
         mkdir($$tempexport,0700);
     }
-    $$tempexport .= '/'.$ENV{'user.domain'}.'_'.$ENV{'user.name'};
+    $$tempexport .= '/'.$env{'user.domain'}.'_'.$env{'user.name'};
     if (!-e $$tempexport) {
         mkdir($$tempexport,0700);
     }
@@ -508,13 +502,13 @@ sub create_ims_store {
 '<manifest xmlns="http://www.imsglobal.org/xsd/imscp_v1p1"'.
 ' xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_v1p2"'.
 ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'.
-' identifier="MANIFEST-'.$ENV{'request.course.id'}.'-'.$now.'"'.
+' identifier="MANIFEST-'.$env{'request.course.id'}.'-'.$now.'"'.
 '  xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1imscp_v1p1.xsd'.
 '  http://www.imsglobal.org/xsd/imsmd_v1p2 imsmd_v1p2p2.xsd">'."\n".
-'  <organizations default="ORG-'.$ENV{'request.course.id'}.'-'.$now.'">'."\n".
-'    <organization identifier="ORG-'.$ENV{'request.course.id'}.'-'.$now.'"'.
+'  <organizations default="ORG-'.$env{'request.course.id'}.'-'.$now.'">'."\n".
+'    <organization identifier="ORG-'.$env{'request.course.id'}.'-'.$now.'"'.
 ' structure="hierarchical">'."\n".
-'      <title>'.$ENV{'request.'.$ENV{'request.course.id'}.'.description'}.'</title>'
+'      <title>'.$env{'request.'.$env{'request.course.id'}.'.description'}.'</title>'
     } else {
         $$outcome .= 'An error occurred opening the IMS manifest file.<br />'
 ;
@@ -532,8 +526,8 @@ sub build_package {
     my $lastcontainer = 0;
     my %parent = ();
     my @dependencies = ();
-    my $cnum = $ENV{'course.'.$ENV{'request.course.id'}.'.num'};
-    my $cdom = $ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
+    my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+    my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
     while ($curRes = $it->next()) {
         if (ref($curRes)) {
             $count ++;
@@ -583,7 +577,7 @@ sub build_package {
                     $isvisible = 'false';
                 }
                 unless ($curRes->is_sequence()) {
-                    $resourceref = 'identifierref="RES-'.$ENV{'request.course.id'}.'-'.$count.'"';
+                    $resourceref = 'identifierref="RES-'.$env{'request.course.id'}.'-'.$count.'"';
                 }
                 if (($depth <= $prevdepth) && ($count > 1) && ($included)) {
                     print $ims_manifest "\n".'  </item>'."\n";
@@ -592,7 +586,7 @@ sub build_package {
                 $prevdepth = $depth;
 
                 my $itementry =
-              '<item identifier="ITEM-'.$ENV{'request.course.id'}.'-'.$count.
+              '<item identifier="ITEM-'.$env{'request.course.id'}.'-'.$count.
               '" isvisible="'.$isvisible.'" '.$resourceref.'>'.
               '<title>'.$curRes->title().'</title>';
                 print $ims_manifest "\n".$itementry;
@@ -603,7 +597,7 @@ sub build_package {
                     &process_content($count,$curRes,$cdom,$cnum,$symb,\$content_file,\@hrefs,$copyresult,$tempexport);
                     if ($content_file) {
                         $imsresources .= "\n".
-                     '   <resource identifier="RES-'.$ENV{'request.course.id'}.'-'.$count.
+                     '   <resource identifier="RES-'.$env{'request.course.id'}.'-'.$count.
                      '" type="webcontent" href="'.$content_file.'">'."\n".
                      '       <file href="'.$content_file.'" />'."\n";
                         foreach (@hrefs) {
@@ -717,7 +711,7 @@ sub process_content {
         $$content_file = &replicate_content($cdom,$cnum,$tempexport,$symb,$count,\$message,$href,'uploaded');
     } elsif ($symb =~ m-\.(sequence|page)___\d+___([^/]+)/([^/]+)-) {
         my $canedit = 0;
-        if ($2 eq $ENV{'user.domain'} && $3 eq $ENV{'user.name'})  {
+        if ($2 eq $env{'user.domain'} && $3 eq $env{'user.name'})  {
             $canedit= 1;
         }
         if ($canedit) {
@@ -859,7 +853,7 @@ sub group_import {
                             '<link from="1" to="2" index="1"></link>'."\n".
                             '<resource id="2" src="" type="finish"></resource>'."\n".
                             '</map>';
-            $ENV{'form.output'}=$newmapstr;
+            $env{'form.output'}=$newmapstr;
             my $home=&Apache::lonnet::homeserver($coursenum,$coursedom);
             my $result=&Apache::lonnet::finishuserfileupload($coursenum,$coursedom,$home,
                                                 'output',$1.$2);
@@ -889,19 +883,19 @@ sub breadcrumbs {
     my ($where)=@_;
     &Apache::lonhtmlcommon::clear_breadcrumbs();
     my (@folders);
-    if ($ENV{'form.pagepath'}) {
-        @folders = split('&',$ENV{'form.pagepath'});
+    if ($env{'form.pagepath'}) {
+        @folders = split('&',$env{'form.pagepath'});
     } else {
-        @folders=split('&',$ENV{'form.folderpath'});
+        @folders=split('&',$env{'form.folderpath'});
     }
     my $folderpath;
     my $cpinfo='';
-    if ($ENV{'form.markedcopy_url'}) {
-	&Apache::lonnet::logthis('Found '.$ENV{'form.markedcopy_url'});
+    if ($env{'form.markedcopy_url'}) {
+	&Apache::lonnet::logthis('Found '.$env{'form.markedcopy_url'});
        $cpinfo='&markedcopy_url='.
-               &Apache::lonnet::escape($ENV{'form.markedcopy_url'}).
+               &Apache::lonnet::escape($env{'form.markedcopy_url'}).
                '&markedcopy_title='.
-               &Apache::lonnet::escape($ENV{'form.markedcopy_title'});
+               &Apache::lonnet::escape($env{'form.markedcopy_title'});
     }
     while (@folders) {
 	my $folder=shift(@folders);
@@ -928,7 +922,7 @@ sub editor {
     my $errtext='';
     my $fatal=0;
     my $container='sequence';
-    if ($ENV{'form.pagepath'}) {
+    if ($env{'form.pagepath'}) {
         $container='page';
     }
     ($errtext,$fatal)=
@@ -937,11 +931,11 @@ sub editor {
        	$Apache::lonratedt::order[0]=1;
         $Apache::lonratedt::resources[1]='';
     }
-    if (defined($ENV{'form.markcopy'})) {
+    if (defined($env{'form.markcopy'})) {
 # Mark for copying
-	my ($title,$url)=split(':',$Apache::lonratedt::resources[$Apache::lonratedt::order[$ENV{'form.markcopy'}]]);
-	$ENV{'form.markedcopy_title'}=$title;
-	$ENV{'form.markedcopy_url'}=$url;
+	my ($title,$url)=split(':',$Apache::lonratedt::resources[$Apache::lonratedt::order[$env{'form.markcopy'}]]);
+	$env{'form.markedcopy_title'}=$title;
+	$env{'form.markedcopy_url'}=$url;
     }
     $r->print(&breadcrumbs($folder));
     if ($fatal) {
@@ -950,32 +944,32 @@ sub editor {
 # ------------------------------------------------------------ Process commands
 
 # ---------------- if they are for this folder and user allowed to make changes
-	if (($allowed) && ($ENV{'form.folder'} eq $folder)) {
+	if (($allowed) && ($env{'form.folder'} eq $folder)) {
 # set parameters and change order
-	    if (defined($ENV{'form.setparms'})) {
-		my $idx=$ENV{'form.setparms'};
+	    if (defined($env{'form.setparms'})) {
+		my $idx=$env{'form.setparms'};
 # set parameters
-		if ($ENV{'form.randpick_'.$idx}) {
-		    &Apache::lonratedt::storeparameter($idx,'parameter_randompick',$ENV{'form.randpick_'.$idx},'int_pos');
+		if ($env{'form.randpick_'.$idx}) {
+		    &Apache::lonratedt::storeparameter($idx,'parameter_randompick',$env{'form.randpick_'.$idx},'int_pos');
 		} else {
 		    &Apache::lonratedt::delparameter($idx,'parameter_randompick');
 		}
-		if ($ENV{'form.hidprs_'.$idx}) {
+		if ($env{'form.hidprs_'.$idx}) {
 		    &Apache::lonratedt::storeparameter($idx,'parameter_hiddenresource','yes','string_yesno');
 		} else {
 		    &Apache::lonratedt::delparameter($idx,'parameter_hiddenresource');
 		}
-		if ($ENV{'form.encprs_'.$idx}) {
+		if ($env{'form.encprs_'.$idx}) {
 		    &Apache::lonratedt::storeparameter($idx,'parameter_encrypturl','yes','string_yesno');
 		} else {
 		    &Apache::lonratedt::delparameter($idx,'parameter_encrypturl');
 		}
 
-		if ($ENV{'form.newpos'}) {
+		if ($env{'form.newpos'}) {
 # change order
 
-		    my $newpos=$ENV{'form.newpos'}-1;
-		    my $currentpos=$ENV{'form.currentpos'}-1;
+		    my $newpos=$env{'form.newpos'}-1;
+		    my $currentpos=$env{'form.currentpos'}-1;
 		    my $i;
 		    my @neworder=();
 		    if ($newpos>$currentpos) {
@@ -1014,10 +1008,10 @@ sub editor {
 		}
 		
 	    }
-	    if ($ENV{'form.pastemarked'}) {
+	    if ($env{'form.pastemarked'}) {
 # paste resource to end of list
-                my $url=$ENV{'form.markedcopy_url'};
-		my $title=$ENV{'form.markedcopy_title'};
+                my $url=$env{'form.markedcopy_url'};
+		my $title=$env{'form.markedcopy_title'};
 # Maps need to be copied first
 		if (($url=~/\.(page|sequence)$/) || ($url=~/^\/uploaded\//)) {
 		    $title=&mt('Copy of').' '.$title;
@@ -1027,7 +1021,7 @@ sub editor {
 		    my $storefn=$newurl;
                     $storefn=~s/^\/\w+\/\w+\/\w+\///;
 		    &Apache::loncreatecourse::writefile
-			($ENV{'request.course.id'},$storefn,
+			($env{'request.course.id'},$storefn,
 			 &Apache::lonnet::getfile($url));
 		    $url=$newurl;
 		}
@@ -1051,8 +1045,8 @@ sub editor {
 
 	    }
 # upload a file, if present
-           if (($ENV{'form.uploaddoc.filename'}) &&
-               ($ENV{'form.cmd'}=~/^upload_(\w+)/)) {
+           if (($env{'form.uploaddoc.filename'}) &&
+               ($env{'form.cmd'}=~/^upload_(\w+)/)) {
 	    if ( ($folder=~/^$1/) || ($1 eq 'default') ) {
 # this is for a course, not a user, so set coursedoc flag
 # probably the only place in the system where this should be "1"
@@ -1061,13 +1055,13 @@ sub editor {
               my $ext='false';
               if ($url=~/^http\:\/\//) { $ext='true'; }
               $url=~s/\:/\&colon;/g;
-	      my $comment=$ENV{'form.comment'};
+	      my $comment=$env{'form.comment'};
               $comment=~s/\</\&lt\;/g;
               $comment=~s/\>/\&gt\;/g;
               $comment=~s/\:/\&colon;/g;
               if ($folder=~/^supplemental/) {
-		  $comment=time.'___&&&___'.$ENV{'user.name'}.'___&&&___'.
-		      $ENV{'user.domain'}.'___&&&___'.$comment;
+		  $comment=time.'___&&&___'.$env{'user.name'}.'___&&&___'.
+		      $env{'user.domain'}.'___&&&___'.$comment;
               }
               $Apache::lonratedt::resources[$newidx]=
                   $comment.':'.$url.':'.$ext.':normal:res';
@@ -1081,8 +1075,8 @@ sub editor {
 	      }
 	     }
             }
-	    if ($ENV{'form.cmd'}) {
-                my ($cmd,$idx)=split(/\_/,$ENV{'form.cmd'});
+	    if ($env{'form.cmd'}) {
+                my ($cmd,$idx)=split(/\_/,$env{'form.cmd'});
                 if ($cmd eq 'del') {
 		    my (undef,$url)=split(':',$Apache::lonratedt::resources[$Apache::lonratedt::order[$idx]]);
 		    if ($url=~m|/+uploaded/\Q$coursedom\E/\Q$coursenum\E/|) {
@@ -1120,7 +1114,7 @@ sub editor {
                        $Apache::lonratedt::resources[
 				       $Apache::lonratedt::order[$idx]]);
                     my $comment=
-                     &HTML::Entities::decode($ENV{'form.title'});
+                     &HTML::Entities::decode($env{'form.title'});
                     $comment=~s/\</\&lt\;/g;
                     $comment=~s/\>/\&gt\;/g;
                     $comment=~s/\:/\&colon;/g;
@@ -1139,9 +1133,9 @@ sub editor {
 		}
             }
 # Group import/search
-	    if ($ENV{'form.importdetail'}) {
+	    if ($env{'form.importdetail'}) {
 		my @imports;
-		foreach (split(/\&/,$ENV{'form.importdetail'})) {
+		foreach (split(/\&/,$env{'form.importdetail'})) {
 		    if (defined($_)) {
 			my ($name,$url)=split(/\=/,$_);
 			$name=&Apache::lonnet::unescape($name);
@@ -1158,8 +1152,8 @@ sub editor {
 		}
             }
 # Loading a complete map
-	   if (($ENV{'form.importmap'}) && ($ENV{'form.loadmap'})) {
-	       foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$ENV{'form.importmap'}))) {
+	   if (($env{'form.importmap'}) && ($env{'form.loadmap'})) {
+	       foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$env{'form.importmap'}))) {
                    my $idx=$#Apache::lonratedt::resources;
                    $idx++;
                    $Apache::lonratedt::resources[$idx]=$_;
@@ -1193,25 +1187,25 @@ sub editor {
 	    $r->print('<tr><td>'.&mt('Currently no documents.').'</td></tr>');
 	}
         $r->print("\n</table>\n");
-	if ($ENV{'form.markedcopy_url'}) {
+	if ($env{'form.markedcopy_url'}) {
 	    $r->print(<<ENDPASTE);
 <p><form name="pasteform" action="/adm/coursedocs" method="post">
-<input type="hidden" name="markedcopy_url" value="$ENV{'form.markedcopy_url'}" />
-<input type="hidden" name="markedcopy_title" value="$ENV{'form.markedcopy_title'}" />
+<input type="hidden" name="markedcopy_url" value="$env{'form.markedcopy_url'}" />
+<input type="hidden" name="markedcopy_title" value="$env{'form.markedcopy_title'}" />
 ENDPASTE
             $r->print(
 	   '<input type="submit" name="pastemarked" value="'.&mt('Paste').
 		      '" /> '.&Apache::loncommon::filedescription(
-		(split(/\./,$ENV{'form.markedcopy_url'}))[-1]).': '.
-		      $ENV{'form.markedcopy_title'});
+		(split(/\./,$env{'form.markedcopy_url'}))[-1]).': '.
+		      $env{'form.markedcopy_title'});
             if ($container eq 'page') {
 		$r->print(<<PAGEINFO);
-<input type="hidden" name="pagepath" value="$ENV{'form.pagepath'}" />
-<input type="hidden" name="pagesymb" value="$ENV{'form.pagesymb'}" />
+<input type="hidden" name="pagepath" value="$env{'form.pagepath'}" />
+<input type="hidden" name="pagesymb" value="$env{'form.pagesymb'}" />
 PAGEINFO
             } else {
 		$r->print(<<FOLDERINFO);
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+<input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
 FOLDERINFO
 	    }
 	    $r->print('</form></p>');
@@ -1242,23 +1236,23 @@ sub entryline {
 # Edit commands
     my $container;
     my $folderpath;
-    if ($ENV{'form.folderpath'}) {
+    if ($env{'form.folderpath'}) {
         $container = 'sequence';
-	$folderpath=&Apache::lonnet::escape($ENV{'form.folderpath'});
-	# $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"');
+	$folderpath=&Apache::lonnet::escape($env{'form.folderpath'});
+	# $htmlfoldername=&HTML::Entities::encode($env{'form.foldername'},'<>&"');
     }
     my ($pagepath,$pagesymb);
-    if ($ENV{'form.pagepath'}) {
+    if ($env{'form.pagepath'}) {
         $container = 'page';
-        $pagepath=&Apache::lonnet::escape($ENV{'form.pagepath'});
-        $pagesymb=&Apache::lonnet::escape($ENV{'form.pagesymb'});
+        $pagepath=&Apache::lonnet::escape($env{'form.pagepath'});
+        $pagesymb=&Apache::lonnet::escape($env{'form.pagesymb'});
     }
     my $cpinfo='';
-    if ($ENV{'form.markedcopy_url'}) {
+    if ($env{'form.markedcopy_url'}) {
        $cpinfo='&markedcopy_url='.
-               &Apache::lonnet::escape($ENV{'form.markedcopy_url'}).
+               &Apache::lonnet::escape($env{'form.markedcopy_url'}).
                '&markedcopy_title='.
-               &Apache::lonnet::escape($ENV{'form.markedcopy_title'});
+               &Apache::lonnet::escape($env{'form.markedcopy_title'});
     }
     if ($allowed) {
 	my $incindex=$index+1;
@@ -1290,13 +1284,13 @@ sub entryline {
                 'ct' => 'Cut',
 		'rn' => 'Rename',
 		'cp' => 'Copy');
-        if ($ENV{'form.pagepath'}) {
+        if ($env{'form.pagepath'}) {
             $line.=(<<END);
 <form name="entry_$index" action="/adm/coursedocs" method="post">
-<input type="hidden" name="pagepath" value="$ENV{'form.pagepath'}" />
-<input type="hidden" name="pagesymb" value="$ENV{'form.pagesymb'}" />
-<input type="hidden" name="markedcopy_url" value="$ENV{'form.markedcopy_url'}" />
-<input type="hidden" name="markedcopy_title" value="$ENV{'form.markedcopy_title'}" />
+<input type="hidden" name="pagepath" value="$env{'form.pagepath'}" />
+<input type="hidden" name="pagesymb" value="$env{'form.pagesymb'}" />
+<input type="hidden" name="markedcopy_url" value="$env{'form.markedcopy_url'}" />
+<input type="hidden" name="markedcopy_title" value="$env{'form.markedcopy_title'}" />
 <input type="hidden" name="setparms" value="$orderidx" />
 <td><table border='0' cellspacing='2' cellpadding='0'>
 <tr><td bgcolor="#DDDDDD">
@@ -1320,9 +1314,9 @@ END
         } else {
             $line.=(<<END); 
 <form name="entry_$index" action="/adm/coursedocs" method="post">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
-<input type="hidden" name="markedcopy_url" value="$ENV{'form.markedcopy_url'}" />
-<input type="hidden" name="markedcopy_title" value="$ENV{'form.markedcopy_title'}" />
+<input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
+<input type="hidden" name="markedcopy_url" value="$env{'form.markedcopy_url'}" />
+<input type="hidden" name="markedcopy_title" value="$env{'form.markedcopy_title'}" />
 <input type="hidden" name="setparms" value="$orderidx" />
 <td><table border='0' cellspacing='2' cellpadding='0'>
 <tr><td bgcolor="#DDDDDD">
@@ -1375,8 +1369,8 @@ END
     if ((!$isfolder) && ($residx) && ($folder!~/supplemental/) && (!$ispage)) {
 	my $symb=&Apache::lonnet::symbclean(
           &Apache::lonnet::declutter('uploaded/'.
-           $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}.'/'.
-           $ENV{'course.'.$ENV{'request.course.id'}.'.num'}.'/'.$folder.
+           $env{'course.'.$env{'request.course.id'}.'.domain'}.'/'.
+           $env{'course.'.$env{'request.course.id'}.'.num'}.'/'.$folder.
            '.sequence').
            '___'.$residx.'___'.
 	   &Apache::lonnet::declutter($url));
@@ -1397,7 +1391,7 @@ END
 	}
 	$url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb);
 	if ($container eq 'page') {
-	    my $symb=$ENV{'form.pagesymb'};
+	    my $symb=$env{'form.pagesymb'};
 	    	    
 	    $url=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($symb))[2]);
 	    $url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb);
@@ -1406,7 +1400,7 @@ END
     my $parameterset='&nbsp;';
     if ($isfolder) {
 	my $foldername=&Apache::lonnet::escape($foldertitle);
-	my $folderpath=$ENV{'form.folderpath'};
+	my $folderpath=$env{'form.folderpath'};
 	if ($folderpath) { $folderpath.='&' };
 	$folderpath.=$folderarg.'&'.$foldername;
 	$url.='folderpath='.&Apache::lonnet::escape($folderpath).$cpinfo;
@@ -1421,14 +1415,14 @@ END
     if ($ispage) {
         my $pagename=&Apache::lonnet::escape($pagetitle);
         my $pagepath;
-        my $folderpath=$ENV{'form.folderpath'};
+        my $folderpath=$env{'form.folderpath'};
         if ($folderpath) { $pagepath = $folderpath.'&' };
         $pagepath.=$pagearg.'&'.$pagename;
-	my $symb=$ENV{'form.pagesymb'};
+	my $symb=$env{'form.pagesymb'};
 	if (!$symb) {
 	    my $path='uploaded/'.
-		$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}.'/'.
-		$ENV{'course.'.$ENV{'request.course.id'}.'.num'}.'/';
+		$env{'course.'.$env{'request.course.id'}.'.domain'}.'/'.
+		$env{'course.'.$env{'request.course.id'}.'.num'}.'/';
 	    $symb=&Apache::lonnet::encode_symb($path.$folder.'.sequence',
 					       $residx,
 					       $path.$pagearg.'.page');
@@ -1464,14 +1458,14 @@ ENDPARMS
 sub tiehash {
     my ($mode)=@_;
     $hashtied=0;
-    if ($ENV{'request.course.fn'}) {
+    if ($env{'request.course.fn'}) {
 	if ($mode eq 'write') {
-	    if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db",
+	    if (tie(%hash,'GDBM_File',$env{'request.course.fn'}.".db",
 		    &GDBM_WRCREAT(),0640)) {
                 $hashtied=2;
 	    }
 	} else {
-	    if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db",
+	    if (tie(%hash,'GDBM_File',$env{'request.course.fn'}.".db",
 		    &GDBM_READER(),0640)) {
                 $hashtied=1;
 	    }
@@ -1606,20 +1600,20 @@ sub checkversions {
     my $starttime=0;
     my $haschanged=0;
     my %setversions=&Apache::lonnet::dump('resourceversions',
-			  $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
-			  $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
+			  $env{'course.'.$env{'request.course.id'}.'.domain'},
+			  $env{'course.'.$env{'request.course.id'}.'.num'});
 
     $hashtied=0;
     &tiehash();
     my %newsetversions=();
-    if ($ENV{'form.setmostrecent'}) {
+    if ($env{'form.setmostrecent'}) {
 	$haschanged=1;
 	foreach (keys %hash) {
 	    if ($_=~/^ids\_(\/res\/.+)$/) {
 		$newsetversions{$1}='mostrecent';
 	    }
 	}
-    } elsif ($ENV{'form.setcurrent'}) {
+    } elsif ($env{'form.setcurrent'}) {
 	$haschanged=1;
 	foreach (keys %hash) {
 	    if ($_=~/^ids\_(\/res\/.+)$/) {
@@ -1629,21 +1623,21 @@ sub checkversions {
 		}
 	    }
 	}
-    } elsif ($ENV{'form.setversions'}) {
+    } elsif ($env{'form.setversions'}) {
 	$haschanged=1;
-	foreach (keys %ENV) {
+	foreach (keys %env) {
 	    if ($_=~/^form\.set_version_(.+)$/) {
 		my $src=$1;
-		if (($ENV{$_}) && ($ENV{$_} ne $setversions{$src})) {
-		    $newsetversions{$src}=$ENV{$_};
+		if (($env{$_}) && ($env{$_} ne $setversions{$src})) {
+		    $newsetversions{$src}=$env{$_};
 		}
 	    }
 	}
     }
     if ($haschanged) {
         if (&Apache::lonnet::put('resourceversions',\%newsetversions,
-			  $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
-			  $ENV{'course.'.$ENV{'request.course.id'}.'.num'}) eq 'ok') {		
+			  $env{'course.'.$env{'request.course.id'}.'.domain'},
+			  $env{'course.'.$env{'request.course.id'}.'.num'}) eq 'ok') {		
 	    $r->print('<h1>'.&mt('Your Version Settings have been Stored').'</h1>');
 	} else {
 	    $r->print('<h1><font color="red">'.&mt('An Error Occured while Attempting to Store your Version Settings').'</font></h1>');
@@ -1651,7 +1645,7 @@ sub checkversions {
 	&mark_hash_old();
     }
     &changewarning($r,'');
-    if ($ENV{'form.timerange'} eq 'all') {
+    if ($env{'form.timerange'} eq 'all') {
 # show all documents
 	$header=&mt('All Documents in Course');
 	$allsel=1;
@@ -1664,28 +1658,28 @@ sub checkversions {
     } else {
 # show documents which changed
 	%changes=&Apache::lonnet::dump
-	 ('versionupdate',$ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
-                     $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
+	 ('versionupdate',$env{'course.'.$env{'request.course.id'}.'.domain'},
+                     $env{'course.'.$env{'request.course.id'}.'.num'});
 	my $firstkey=(keys %changes)[0];
 	unless ($firstkey=~/^error\:/) {
-	    unless ($ENV{'form.timerange'}) {
-		$ENV{'form.timerange'}=604800;
+	    unless ($env{'form.timerange'}) {
+		$env{'form.timerange'}=604800;
 	    }
-	    my $seltext=&mt('during the last').' '.$ENV{'form.timerange'}.' '
+	    my $seltext=&mt('during the last').' '.$env{'form.timerange'}.' '
 		.&mt('seconds');
-	    if ($ENV{'form.timerange'}==-1) {
+	    if ($env{'form.timerange'}==-1) {
 		$seltext='since start of course';
 		$startsel='selected';
-		$ENV{'form.timerange'}=time;
+		$env{'form.timerange'}=time;
 	    }
-	    $starttime=time-$ENV{'form.timerange'};
-	    if ($ENV{'form.timerange'}==2592000) {
+	    $starttime=time-$env{'form.timerange'};
+	    if ($env{'form.timerange'}==2592000) {
 		$seltext=&mt('during the last month').' ('.&Apache::lonlocal::locallocaltime($starttime).')';
 		$monthsel='selected';
-	    } elsif ($ENV{'form.timerange'}==604800) {
+	    } elsif ($env{'form.timerange'}==604800) {
 		$seltext=&mt('during the last week').' ('.&Apache::lonlocal::locallocaltime($starttime).')';
 		$weeksel='selected';
-	    } elsif ($ENV{'form.timerange'}==86400) {
+	    } elsif ($env{'form.timerange'}==86400) {
 		$seltext=&mt('since yesterday').' ('.&Apache::lonlocal::locallocaltime($starttime).')';
 		$daysel='selected';
 	    }
@@ -1695,8 +1689,8 @@ sub checkversions {
 	}
     }
     %setversions=&Apache::lonnet::dump('resourceversions',
-			  $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
-			  $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
+			  $env{'course.'.$env{'request.course.id'}.'.domain'},
+			  $env{'course.'.$env{'request.course.id'}.'.num'});
     my %lt=&Apache::lonlocal::texthash
 	      ('st' => 'Version changes since start of Course',
 	       'lm' => 'Version changes since last Month',
@@ -1860,11 +1854,11 @@ sub changewarning {
     my ($r,$postexec)=@_;
     if (!&is_hash_old()) { return; }
     my $pathvar='folderpath';
-    my $path=&Apache::lonnet::escape($ENV{'form.folderpath'});
-    if (defined($ENV{'form.pagepath'})) {
+    my $path=&Apache::lonnet::escape($env{'form.folderpath'});
+    if (defined($env{'form.pagepath'})) {
 	$pathvar='pagepath';
-	$path=&Apache::lonnet::escape($ENV{'form.pagepath'});
-	$path.='&amp;symb='.&Apache::lonnet::escape($ENV{'form.pagesymb'});
+	$path=&Apache::lonnet::escape($env{'form.pagepath'});
+	$path.='&amp;symb='.&Apache::lonnet::escape($env{'form.pagesymb'});
     }
     $r->print(
 '<script>function reinit(tf) { tf.submit();'.$postexec.' }</script>'. 
@@ -1874,7 +1868,7 @@ $pathvar.'='.$path.
 '" /><input type="hidden" name="selectrole" value="1" /><h3><font color="red">'.
 &mt('Changes will become active for your current session after').
 ' <input type="hidden" name="'.
-$ENV{'request.role'}.'" value="1" /><input type="button" value="'.
+$env{'request.role'}.'" value="1" /><input type="button" value="'.
 &mt('re-initializing course').'" onClick="reinit(this.form)"/>'.&mt(', or the next time you log in.').
 $help{'Caching'}.'</font></h3></form>');
 }
@@ -1908,18 +1902,18 @@ sub handler {
 		  'Docs_About_My_Personal_Info,Docs_Editing_Templated_Pages');
     $help{'Caching'} = &Apache::loncommon::help_open_topic('Caching');
 
-  if ($ENV{'form.verify'}) {
+  if ($env{'form.verify'}) {
       &verifycontent($r);
-  } elsif ($ENV{'form.versions'}) {
+  } elsif ($env{'form.versions'}) {
       &checkversions($r);
-  } elsif ($ENV{'form.dumpcourse'}) {
+  } elsif ($env{'form.dumpcourse'}) {
       &dumpcourse($r);
-  } elsif ($ENV{'form.exportcourse'}) {
+  } elsif ($env{'form.exportcourse'}) {
       &exportcourse($r);
   } else {
 # is this a standard course?
 
-    my $standard=($ENV{'request.course.uri'}=~/^\/uploaded\//);
+    my $standard=($env{'request.course.uri'}=~/^\/uploaded\//);
     my $forcestandard = 0;
     my $forcesupplement;
     my $script='';
@@ -1930,32 +1924,32 @@ sub handler {
     my $uploadtag;
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
     ['folderpath','pagepath','pagesymb','markedcopy_url','markedcopy_title']);
-    if ($ENV{'form.folderpath'}) {
-	my (@folderpath)=split('&',$ENV{'form.folderpath'});
-	$ENV{'form.foldername'}=&Apache::lonnet::unescape(pop(@folderpath));
-	$ENV{'form.folder'}=pop(@folderpath);
-    }
-    if ($ENV{'form.pagepath'}) {
-        my (@pagepath)=split('&',$ENV{'form.pagepath'});
-        $ENV{'form.pagename'}=&Apache::lonnet::unescape(pop(@pagepath));
-        $ENV{'form.folder'}=pop(@pagepath);
+    if ($env{'form.folderpath'}) {
+	my (@folderpath)=split('&',$env{'form.folderpath'});
+	$env{'form.foldername'}=&Apache::lonnet::unescape(pop(@folderpath));
+	$env{'form.folder'}=pop(@folderpath);
+    }
+    if ($env{'form.pagepath'}) {
+        my (@pagepath)=split('&',$env{'form.pagepath'});
+        $env{'form.pagename'}=&Apache::lonnet::unescape(pop(@pagepath));
+        $env{'form.folder'}=pop(@pagepath);
         $containertag = '<input type="hidden" name="pagepath" value="" />'.
 	    '<input type="hidden" name="pagesymb" value="" />';
-        $uploadtag = '<input type="hidden" name="pagepath" value="'.$ENV{'form.pagepath'}.'" />'.
-	    '<input type="hidden" name="pagesymb" value="'.$ENV{'form.pagesymb'}.'" />';
+        $uploadtag = '<input type="hidden" name="pagepath" value="'.$env{'form.pagepath'}.'" />'.
+	    '<input type="hidden" name="pagesymb" value="'.$env{'form.pagesymb'}.'" />';
     }
     if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) {
        $showdoc='/'.$1;
     }
     unless ($showdoc) { # got called from remote
-       if (($ENV{'form.folder'}=~/^default_/) || 
-          ($ENV{'form.folder'} =~ m#^\d+/(pages|sequences)/#)) {
+       if (($env{'form.folder'}=~/^default_/) || 
+          ($env{'form.folder'} =~ m#^\d+/(pages|sequences)/#)) {
            $forcestandard = 1;
        } 
-       $forcesupplement=($ENV{'form.folder'}=~/^supplemental_/);
+       $forcesupplement=($env{'form.folder'}=~/^supplemental_/);
 
 # does this user have privileges to post, etc?
-       $allowed=&Apache::lonnet::allowed('mdc',$ENV{'request.course.id'});
+       $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
        if ($allowed) { 
          &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']);
          $script=&Apache::lonratedt::editscript('simple'); 
@@ -1968,13 +1962,13 @@ sub handler {
     }
 
 # get course data
-    my $coursenum=$ENV{'course.'.$ENV{'request.course.id'}.'.num'};
-    my $coursedom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
+    my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'};
+    my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'};
 
 # get personal data
  
-    my $uname=$ENV{'user.name'};
-    my $udom=$ENV{'user.domain'};
+    my $uname=$env{'user.name'};
+    my $udom=$env{'user.domain'};
     my $plainname=&Apache::lonnet::escape(
                      &Apache::loncommon::plainname($uname,$udom));
 
@@ -2195,15 +2189,15 @@ ENDNEWSCRIPT
 					 'cv' => 'Check/Set Resource Versions',
 					  );
 
-       my $folderpath=$ENV{'form.folderpath'};
+       my $folderpath=$env{'form.folderpath'};
        if (!$folderpath) {
-	   if ($ENV{'form.folder'} eq '' ||
-	       $ENV{'form.folder'} eq 'supplemental') {
+	   if ($env{'form.folder'} eq '' ||
+	       $env{'form.folder'} eq 'supplemental') {
 	       $folderpath='default&'.
 		   &Apache::lonnet::escape(&mt('Main Course Documents'));
 	   }
        }
-       unless ($ENV{'form.pagepath'}) {
+       unless ($env{'form.pagepath'}) {
            $containertag = '<input type="hidden" name="folderpath" value="" />';
            $uploadtag = '<input type="hidden" name="folderpath" value="'.$folderpath.'" />';
        }
@@ -2239,10 +2233,10 @@ ENDCOURSEVERIFY
 	$r->print('<tr><td bgcolor="#BBBBBB">');
 #  '<h2>'.&mt('Main Course Documents').
 #  ($allowed?' '.$help{'Main_Course_Documents'}:'').'</h2>');
-       my $folder=$ENV{'form.folder'};
+       my $folder=$env{'form.folder'};
        if ($folder eq '' || $folder eq 'supplemental') {
            $folder='default';
-	   $ENV{'form.folderpath'}='default&'.&Apache::lonnet::escape(&mt('Main Course Documents'));
+	   $env{'form.folderpath'}='default&'.&Apache::lonnet::escape(&mt('Main Course Documents'));
        }
        my $postexec='';
        if ($folder eq 'default') {
@@ -2302,7 +2296,7 @@ $help{'Load_Map'}</nobr>
 </p>
 </form>
 ENDFORM
-       unless ($ENV{'form.pagepath'}) {
+       unless ($env{'form.pagepath'}) {
 	   $r->print(<<ENDFORM);
 <hr />
 <form action="/adm/coursedocs" method="post" name="newext">
@@ -2321,10 +2315,10 @@ value="$lt{'extr'}" /> $help{'Adding_Ext
 ENDFORM
        }
        $r->print('</td><td bgcolor="#DDDDDD">');
-       unless ($ENV{'form.pagepath'}) {
+       unless ($env{'form.pagepath'}) {
            $r->print(<<ENDFORM);
 <form action="/adm/coursedocs" method="post" name="newfolder">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+<input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
 <input type=hidden name="importdetail" value="">
 <nobr>
 <input name="newfolder" type="button"
@@ -2333,7 +2327,7 @@ value="$lt{'newf'}" />$help{'Adding_Fold
 </nobr>
 </form>
 <form action="/adm/coursedocs" method="post" name="newpage">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+<input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
 <input type=hidden name="importdetail" value="">
 <nobr>
 <input name="newpage" type="button"
@@ -2411,7 +2405,7 @@ onClick="javascript:makeabout();" />
 </nobr>
 ENDFORM
        }
-       if ($ENV{'form.pagepath'}) {
+       if ($env{'form.pagepath'}) {
            $r->print(<<ENDBLOCK);
 <form action="/adm/coursedocs" method="post" name="newsmpproblem">
 $uploadtag
@@ -2441,13 +2435,13 @@ ENDBLOCK
        $r->print('<tr><td bgcolor="#BBBBBB">');
 # '<h2>'.&mt('Supplemental Course Documents').
 #  ($allowed?' '.$help{'Supplemental'}:'').'</h2>');
-       my $folder=$ENV{'form.folder'};
+       my $folder=$env{'form.folder'};
        unless ($folder=~/^supplemental/) {
 	   $folder='supplemental';
        }
        if ($folder =~ /^supplemental$/ &&
-	   $ENV{'form.folderpath'} =~ /^default\&/) {
-	   $ENV{'form.folderpath'}='supplemental&'.
+	   $env{'form.folderpath'} =~ /^default\&/) {
+	   $env{'form.folderpath'}='supplemental&'.
 	       &Apache::lonnet::escape(&mt('Supplemental Course Documents'));
        }
        &editor($r,$coursenum,$coursedom,$folder,$allowed);
@@ -2468,7 +2462,7 @@ ENDBLOCK
 <textarea cols=50 rows=4 name='comment'>
 </textarea>
 <br />
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+<input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
 <input type="hidden" name="cmd" value="upload_supplemental">
 <nobr>
 <input type="submit" value="$lt{'upld'}">
@@ -2478,7 +2472,7 @@ ENDBLOCK
 </td>
 <td bgcolor="#DDDDDD">
 <form action="/adm/coursedocs" method="post" name="supnewfolder">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+<input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
 <input type=hidden name="importdetail" value="">
 <nobr>
 <input name="newfolder" type="button"
@@ -2487,7 +2481,7 @@ value="$lt{'newf'}" /> $help{'Adding_Fol
 </nobr>
 </form>
 <form action="/adm/coursedocs" method="post" name="supnewext">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+<input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
 <input type=hidden name="importdetail" value="">
 <nobr>
 <input name="newext" type="button" 
@@ -2496,7 +2490,7 @@ value="$lt{'extr'}" /> $help{'Adding_Ext
 </nobr>
 </form>
 <form action="/adm/coursedocs" method="post" name="supnewsyl">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+<input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
 <input type=hidden name="importdetail" 
 value="Syllabus=/public/$coursedom/$coursenum/syllabus">
 <nobr>
@@ -2505,7 +2499,7 @@ $help{'Syllabus'}
 </nobr>
 </form>
 <form action="/adm/coursedocs" method="post" name="subnewaboutme">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+<input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
 <input type=hidden name="importdetail" 
 value="$plainname=/adm/$udom/$uname/aboutme">
 <nobr>