--- loncom/imspackages/imsimportdocs.pm 2004/03/21 20:44:58 1.5 +++ loncom/imspackages/imsimportdocs.pm 2009/11/20 14:39:32 1.26 @@ -1,3 +1,30 @@ +# The LearningOnline Network with CAPA +# +# $Id: imsimportdocs.pm,v 1.26 2009/11/20 14:39:32 bisitz Exp $ +# +# Copyright Michigan State University Board of Trustees +# +# This file is part of the LearningOnline Network with CAPA (LON-CAPA). +# +# LON-CAPA is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# LON-CAPA is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LON-CAPA; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# /home/httpd/html/adm/gpl.txt +# +# http://www.lon-capa.org/ +# + package Apache::imsimportdocs; use Apache::Constants qw(:common :http :methods); @@ -7,6 +34,10 @@ use Apache::loncommon; use Apache::lonlocal; use Apache::imsprocessor; use LONCAPA::Configuration; +use LONCAPA::map(); +use lib '/home/httpd/lib/perl/'; +use LONCAPA; + use strict; sub jscript_one { @@ -120,59 +151,62 @@ sub handler { &Apache::imsprocessor::ims_config(\@areas,\%cmsmap,\%areaname); # get course data - my $coursenum=$ENV{'course.'.$ENV{'request.course.id'}.'.num'}; - my $coursedom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; - my $coursehome=$ENV{'course.'.$ENV{'request.course.id'}.'.home'}; + 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 $plainname=&Apache::lonnet::escape( + my $uname=$env{'user.name'}; + my $udom=$env{'user.domain'}; + my $plainname=&escape( &Apache::loncommon::plainname($uname,$udom)); # does this user have privileges to post, etc? - my $allowed=&Apache::lonnet::allowed('mdc',$ENV{'request.course.id'}); + my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'}); unless ($allowed) { - $r->print("