--- loncom/interface/londocs.pm 2008/12/11 14:55:15 1.319
+++ loncom/interface/londocs.pm 2008/12/13 00:19:07 1.320
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.319 2008/12/11 14:55:15 bisitz Exp $
+# $Id: londocs.pm,v 1.320 2008/12/13 00:19:07 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -84,14 +84,14 @@ sub authorhosts {
my %outhash=();
my $home=0;
my $other=0;
- foreach (keys %env) {
- if ($_=~/^user\.role\.(au|ca)\.(.+)$/) {
+ foreach my $key (keys(%env)) {
+ if ($key=~/^user\.role\.(au|ca)\.(.+)$/) {
my $role=$1;
my $realm=$2;
- my ($start,$end)=split(/\./,$env{$_});
+ my ($start,$end)=split(/\./,$env{$key});
if (($start) && ($start>time)) { next; }
if (($end) && (time>$end)) { next; }
- my $ca; my $cd;
+ my ($ca,$cd);
if ($1 eq 'au') {
$ca=$env{'user.name'};
$cd=$env{'user.domain'};
@@ -159,15 +159,15 @@ sub dumpcourse {
my $title=$env{'form.authorfolder'};
$title=&clean($title);
my %replacehash=();
- foreach (keys %env) {
- if ($_=~/^form\.namefor\_(.+)/) {
- $replacehash{$1}=$env{$_};
+ foreach my $key (keys(%env)) {
+ if ($key=~/^form\.namefor\_(.+)/) {
+ $replacehash{$1}=$env{$key};
}
}
my $crs='/uploaded/'.$env{'request.course.id'}.'/';
$crs=~s/\_/\//g;
- foreach (keys %replacehash) {
- my $newfilename=$title.'/'.$replacehash{$_};
+ foreach my $item (keys(%replacehash)) {
+ my $newfilename=$title.'/'.$replacehash{$item};
$newfilename=~s/\.(\w+)$//;
my $ext=$1;
$newfilename=&clean($newfilename);
@@ -182,16 +182,16 @@ sub dumpcourse {
unless(mkdir($makepath,0777)) { $fail=1; }
}
}
- $r->print('
'.$_.' => '.$newfilename.': ');
+ $r->print('
'.$item.' => '.$newfilename.': ');
if (my $fh=Apache::File->new('>'.$path.'/'.$newfilename)) {
- if ($_=~/\.(sequence|page|html|htm|xml|xhtml)$/) {
+ if ($item=~/\.(sequence|page|html|htm|xml|xhtml)$/) {
print $fh &Apache::lonclonecourse::rewritefile(
- &Apache::lonclonecourse::readfile($env{'request.course.id'},$_),
+ &Apache::lonclonecourse::readfile($env{'request.course.id'},$item),
(%replacehash,$crs => '')
);
} else {
print $fh
- &Apache::lonclonecourse::readfile($env{'request.course.id'},$_);
+ &Apache::lonclonecourse::readfile($env{'request.course.id'},$item);
}
$fh->close();
} else {
@@ -209,8 +209,8 @@ sub dumpcourse {
$r->print(
'