--- loncom/imspackages/imsimport.pm 2005/02/21 23:47:46 1.10
+++ loncom/imspackages/imsimport.pm 2005/10/27 18:19:36 1.12
@@ -365,8 +365,8 @@ END_OF_ONE
sub display_two {
my ($r,$zipupload,$areas,$areaname,$cmsmap,$uname,$newdir,$numcrs,$fullpath) = @_;
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['folder','source']);
- my $cms = $ENV{'form.source'};
- my $dirname = $ENV{'form.newdir'};
+ my $cms = $env{'form.source'};
+ my $dirname = $env{'form.newdir'};
my $tempdir = &Apache::imsprocessor::create_tempdir('CSTR',$dirname,'');
my $fname = &Apache::imsprocessor::uploadzip('CSTR',$tempdir,$zipupload);
my $unzip_result = '';
@@ -557,7 +557,7 @@ Choose course:
-
+
@@ -606,20 +606,18 @@ sub display_three {
my ($r,$uname,$udom,$areas,$areaname,$cmsmap,$destdir,$newdir) = @_;
my $crs = '';
my $cdom = '';
- my $chome = '';
my $db_handling = '';
my $timenow = time;
my $announce_handling = 'ok';
- my $cms = $ENV{'form.source'};
- if ( defined($ENV{'form.bb_crs'}) ) {
- ($cdom,$crs) = split/\//,$ENV{'form.bb_crs'};
- $chome = &Apache::lonnet::homeserver($crs,$cdom);
+ my $cms = $env{'form.source'};
+ if ( defined($env{'form.bb_crs'}) ) {
+ ($cdom,$crs) = split/\//,$env{'form.bb_crs'};
}
my $user_crs = '';
my $user_cdom = '';
my $user_handling = '';
- if ( defined($ENV{'form.user_crs'}) ) {
- ($user_cdom,$user_crs) = split/\//,$ENV{'form.user_crs'};
+ if ( defined($env{'form.user_crs'}) ) {
+ ($user_cdom,$user_crs) = split/\//,$env{'form.user_crs'};
}
my $seqstem = "/res/$udom/$uname/$newdir";
my %importareas = ();
@@ -645,10 +643,10 @@ sub display_three {
my @sequences = ();
my @resrcfiles = ();
- my $tempdir = $ENV{'form.tempdir'};
+ my $tempdir = $env{'form.tempdir'};
foreach my $area (@{$areas}) {
- if (defined($ENV{"form.$area"}) ) {
+ if (defined($env{"form.$area"}) ) {
if ($cms eq 'angel' && $area eq 'doc') {
foreach (@{$$cmsmap{$cms}{$area}}) {
$importareas{$_} = 1;
@@ -657,9 +655,9 @@ sub display_three {
$importareas{$$cmsmap{$cms}{$area}} = 1;
}
if ($area eq 'board') {
- $db_handling = $ENV{'form.db_handling'};
+ $db_handling = $env{'form.db_handling'};
} elsif ($area eq 'users') {
- $user_handling = $ENV{'form.user_handling'};
+ $user_handling = $env{'form.user_handling'};
}
}
}
@@ -699,7 +697,7 @@ sub display_three {
&Apache::imsprocessor::process_resinfo($cms,'CSTR',$tempdir,$destdir,\%items,\%resources,\@targets,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\@groups,\%messages,\@timestamp,\%boardnum,\%resinfo,$udom,$uname,$cdom,$crs,$db_handling,$user_handling,\%total,$seqstem,$seqstem,\@resrcfiles,\@packages,\%hrefs,\@pages,\@sequences,\%randompicks);
- my $copy_result = &Apache::imsprocessor::copy_resources('CSTR',$cms,\%hrefs,$tempdir,\@targets,\%urls,$crs,$cdom,$chome,$destdir,$timenow,\%importareas);
+ my $copy_result = &Apache::imsprocessor::copy_resources('CSTR',$cms,\%hrefs,$tempdir,\@targets,\%urls,$crs,$cdom,$destdir,$timenow,\%importareas);
&Apache::imsprocessor::build_structure($cms,'CSTR',$destdir,\%items,\%resinfo,\%resources,\@targets,\%hrefs,$udom,$uname,$newdir,$timenow,$cdom,$crs,\@timestamp,\%total,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\%boardnum,\@pages,\@sequences,\@topurls,\@topnames,\@packages,\%includeditems,\%randompicks);
@@ -805,36 +803,36 @@ sub handler {
my $qcount = '';
# get personal information for this user
- my $user=$ENV{'user.name'};
- my $dom=$ENV{'user.domain'};
+ my $user=$env{'user.name'};
+ my $dom=$env{'user.domain'};
#
# re-attach user
#
- if ($ENV{'form.uploaduname'}) {
- $ENV{'form.filename'}='/priv/'.$ENV{'form.uploaduname'}.'/'.
- $ENV{'form.filename'};
+ if ($env{'form.uploaduname'}) {
+ $env{'form.filename'}='/priv/'.$env{'form.uploaduname'}.'/'.
+ $env{'form.filename'};
}
($uname,$udom)=
- &Apache::loncacc::constructaccess($ENV{'form.filename'},
+ &Apache::loncacc::constructaccess($env{'form.filename'},
$r->dir_config('lonDefDomain'));
unless (($uname) && ($udom)) {
$r->log_reason($uname.' at '.$udom.
- ' trying to publish file '.$ENV{'form.filename'}.
+ ' trying to publish file '.$env{'form.filename'}.
' - not authorized',
$r->filename);
return HTTP_NOT_ACCEPTABLE;
}
my $fn;
- if ($ENV{'form.filename'}) {
- $fn=$ENV{'form.filename'};
+ if ($env{'form.filename'}) {
+ $fn=$env{'form.filename'};
$fn=~s/^http\:\/\/[^\/]+\///;
$fn=~s/^\///;
$fn=~s/(\~|priv\/)(\w+)//;
$fn=~s/\/+/\//g;
} else {
- $r->log_reason($ENV{'user.name'}.' at '.$ENV{'user.domain'}.
+ $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.
' unspecified filename for upload', $r->filename);
return HTTP_NOT_FOUND;
}
@@ -856,35 +854,35 @@ sub handler {
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
- if ($ENV{'form.phase'} eq 'two') {
+ if ($env{'form.phase'} eq 'two') {
&jscript_one($fullpath,\$javascript,$uname,$udom);
- } elsif ($ENV{'form.phase'} eq 'three') {
+ } elsif ($env{'form.phase'} eq 'three') {
&jscript_two(\$javascript,$user,$dom,\$numcrs);
- } elsif ($ENV{'form.phase'} eq 'four') {
+ } elsif ($env{'form.phase'} eq 'four') {
&jscript_three(\$javascript);
}
$r->print("LON-CAPA Construction Space\n");
$r->print(&Apache::loncommon::bodytag('Upload IMS package to Construction Space',undef,$loadentries));
- if (($uname ne $ENV{'user.name'}) || ($udom ne $ENV{'user.domain'})) {
+ if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
$r->print(''.&mt('Co-Author').': '.$uname.
&mt(' at ').$udom.'');
}
- if ($ENV{'form.phase'} eq 'two') {
+ if ($env{'form.phase'} eq 'two') {
my $flag = &Apache::lonupload::phasetwo($r,$fn,$uname,$udom,'imsimport');
if ($flag eq 'ok') {
&display_one($r,$uname,$fn,$fullpath);
}
- } elsif ( ($ENV{'form.phase'} eq 'three') || ($ENV{'form.phase'} eq 'four') ) {
- my $docroot = $ENV{'form.newdir'};
+ } elsif ( ($env{'form.phase'} eq 'three') || ($env{'form.phase'} eq 'four') ) {
+ my $docroot = $env{'form.newdir'};
my $newdir = '';
if ($docroot =~ m|public_html/(.+)$|) {
$newdir = $1;
}
- if ($ENV{'form.phase'} eq 'three') {
+ if ($env{'form.phase'} eq 'three') {
&display_two ($r,$zipupload,\@areas,\%areaname,\%cmsmap,$uname,$newdir,\$numcrs,$fullpath);
- } elsif ($ENV{'form.phase'} eq 'four') {
+ } elsif ($env{'form.phase'} eq 'four') {
&display_three ($r,$uname,$udom,\@areas,\%areaname,\%cmsmap,$docroot,$newdir);
}
} else {
|