[LON-CAPA-cvs] cvs: loncom / LONCAPA.pm lonenc.pm lontrans.pm /auth lonlogin.pm lonroles.pm /homework bridgetask.pm chemresponse.pm drawimage.pm edit.pm essayresponse.pm grades.pm imagechoice.pm imageresponse.pm inputtags.pm lonsimpleproblemedit.pm randomlabel.pm randomlylabel.pm structuretags.pm /imspackages imsexport.pm imsimportdocs.pm /interface lonchatfetch.pm loncommon.pm loncoursedata.pm loncoursegroups.pm loncreatecourse.pm loncreateuser.pm londocs.pm lonfeedback.pm longroupchat.pm lonhelp.pm lonhelper.pm lonhelpmenu.pm lonhtmlcommon.pm lonmenu.pm lonmeta.pm lonmodifycourse.pm lonmsg.pm lonmsgdisplay.pm lonnavmaps.pm lonnotify.pm lonparmset.pm lonpickcourse.pm lonprintout.pm lonsearchcat.pm lonstatistics.pm lonsupportreq.pm lontrackstudent.pm lonwhatsnew.pm portfolio.pm slotrequest.pm /interface/spreadsheet Spreadsheet.pm studentcalc.pm /interface/statistics lonclassifystudents.pm lonpercentage.pm lonproblemanalysis.pm lonproblemstatistics.pm lonstathelpers.pm lonstudentassessment.pm lonstudentsubmissions.pm lonsurveyreports.pm /lonnet/perl lonnet.pm /publisher loncfile.pm loncleanup.pm lonpublisher.pm /xml lonplot.pm lontexconvert.pm
www
lon-capa-cvs@mail.lon-capa.org
Tue, 30 May 2006 12:48:01 -0000
This is a MIME encoded message
--www1148993281
Content-Type: text/plain
www Tue May 30 08:48:01 2006 EDT
Modified files:
/loncom LONCAPA.pm lonenc.pm lontrans.pm
/loncom/auth lonlogin.pm lonroles.pm
/loncom/homework bridgetask.pm chemresponse.pm drawimage.pm edit.pm
essayresponse.pm grades.pm imagechoice.pm
imageresponse.pm inputtags.pm
lonsimpleproblemedit.pm randomlabel.pm
randomlylabel.pm structuretags.pm
/loncom/imspackages imsexport.pm imsimportdocs.pm
/loncom/interface lonchatfetch.pm loncommon.pm loncoursedata.pm
loncoursegroups.pm loncreatecourse.pm
loncreateuser.pm londocs.pm lonfeedback.pm
longroupchat.pm lonhelp.pm lonhelper.pm
lonhelpmenu.pm lonhtmlcommon.pm lonmenu.pm
lonmeta.pm lonmodifycourse.pm lonmsg.pm
lonmsgdisplay.pm lonnavmaps.pm lonnotify.pm
lonparmset.pm lonpickcourse.pm lonprintout.pm
lonsearchcat.pm lonstatistics.pm lonsupportreq.pm
lontrackstudent.pm lonwhatsnew.pm portfolio.pm
slotrequest.pm
/loncom/interface/spreadsheet Spreadsheet.pm studentcalc.pm
/loncom/interface/statistics lonclassifystudents.pm
lonpercentage.pm lonproblemanalysis.pm
lonproblemstatistics.pm
lonstathelpers.pm
lonstudentassessment.pm
lonstudentsubmissions.pm
lonsurveyreports.pm
/loncom/lonnet/perl lonnet.pm
/loncom/publisher loncfile.pm loncleanup.pm lonpublisher.pm
/loncom/xml lonplot.pm lontexconvert.pm
Log:
&Apache::lonnet::unescape -> &unescape
&Apache::lonnet::escape -> &escape
--www1148993281
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20060530084801.txt"
Index: loncom/LONCAPA.pm
diff -u loncom/LONCAPA.pm:1.1 loncom/LONCAPA.pm:1.2
--- loncom/LONCAPA.pm:1.1 Mon May 8 18:05:54 2006
+++ loncom/LONCAPA.pm Tue May 30 08:45:12 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Base routines
#
-# $Id: LONCAPA.pm,v 1.1 2006/05/08 22:05:54 albertel Exp $
+# $Id: LONCAPA.pm,v 1.2 2006/05/30 12:45:12 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -30,11 +30,20 @@
package LONCAPA;
use strict;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA::Configuration;
+use Fcntl qw(:flock);
+use GDBM_File;
+use POSIX;
+
+my $loncapa_max_wait_time = 13;
+
require Exporter;
our @ISA = qw (Exporter);
-our @EXPORT = qw(&add_get_param &escape &unescape);
+our @EXPORT = qw(&add_get_param &escape &unescape &tie_domain_hash &untie_domain_hash &tie_user_hash &untie_user_hash &propath);
+my %perlvar;
-# Inputs are a url, adn a hash ref of
+# Inputs are a url, and a hash ref of
# form name => value pairs
# takes care of properly adding the form name elements and values to the
# the url doing proper escaping of the values and joining with ? or & as
@@ -72,6 +81,209 @@
return $str;
}
+# -------------------------------------------- Return path to profile directory
+
+sub propath {
+ my ($udom,$uname)=@_;
+ $udom=~s/\W//g;
+ $uname=~s/\W//g;
+ my $subdir=$uname.'__';
+ $subdir =~ s/(.)(.)(.).*/$1\/$2\/$3/;
+ my $proname="$perlvar{'lonUsersDir'}/$udom/$subdir/$uname";
+ return $proname;
+}
+
+
+#---------------------------------------------------------------
+#
+# Manipulation of hash based databases (factoring out common code
+# for later use as we refactor.
+#
+# Ties a domain level resource file to a hash.
+# If requested a history entry is created in the associated hist file.
+#
+# Parameters:
+# domain - Name of the domain in which the resource file lives.
+# namespace - Name of the hash within that domain.
+# how - How to tie the hash (e.g. GDBM_WRCREAT()).
+# loghead - Optional parameter, if present a log entry is created
+# in the associated history file and this is the first part
+# of that entry.
+# logtail - Goes along with loghead, The actual logentry is of the
+# form $loghead:<timestamp>:logtail.
+# Returns:
+# Reference to a hash bound to the db file or alternatively undef
+# if the tie failed.
+#
+sub tie_domain_hash {
+ my ($domain,$namespace,$how,$loghead,$logtail) = @_;
+
+ # Filter out any whitespace in the domain name:
+
+ $domain =~ s/\W//g;
+
+ # We have enough to go on to tie the hash:
+
+ my $user_top_dir = $perlvar{'lonUsersDir'};
+ my $domain_dir = $user_top_dir."/$domain";
+ my $resource_file = $domain_dir."/$namespace";
+ return &_locking_hash_tie($resource_file,$namespace,$how,$loghead,$logtail);
+}
+
+sub untie_domain_hash {
+ return &_locking_hash_untie(@_);
+}
+#
+# Ties a user's resource file to a hash.
+# If necessary, an appropriate history
+# log file entry is made as well.
+# This sub factors out common code from the subs that manipulate
+# the various gdbm files that keep keyword value pairs.
+# Parameters:
+# domain - Name of the domain the user is in.
+# user - Name of the 'current user'.
+# namespace - Namespace representing the file to tie.
+# how - What the tie is done to (e.g. GDBM_WRCREAT().
+# loghead - Optional first part of log entry if there may be a
+# history file.
+# what - Optional tail of log entry if there may be a history
+# file.
+# Returns:
+# hash to which the database is tied. It's up to the caller to untie.
+# undef if the has could not be tied.
+#
+sub tie_user_hash {
+ my ($domain,$user,$namespace,$how,$loghead,$what) = @_;
+
+ $namespace=~s/\//\_/g; # / -> _
+ $namespace=~s/\W//g; # whitespace eliminated.
+ my $proname = &propath($domain, $user);
+
+ my $file_prefix="$proname/$namespace";
+ return &_locking_hash_tie($file_prefix,$namespace,$how,$loghead,$what);
+}
+
+sub untie_user_hash {
+ return &_locking_hash_untie(@_);
+}
+
+# internal routines that handle the actual tieing and untieing process
+
+sub _do_hash_tie {
+ my ($file_prefix,$namespace,$how,$loghead,$what) = @_;
+ my %hash;
+ if(tie(%hash, 'GDBM_File', "$file_prefix.db", $how, 0640)) {
+ # If this is a namespace for which a history is kept,
+ # make the history log entry:
+ if (($namespace !~/^nohist\_/) && (defined($loghead))) {
+ my $args = scalar @_;
+ Debug(" Opening history: $file_prefix $args");
+ my $hfh = IO::File->new(">>$file_prefix.hist");
+ if($hfh) {
+ my $now = time;
+ print $hfh "$loghead:$now:$what\n";
+ }
+ $hfh->close;
+ }
+ return \%hash;
+ } else {
+ return undef;
+ }
+}
+
+sub _do_hash_untie {
+ my ($hashref) = @_;
+ my $result = untie(%$hashref);
+ return $result;
+}
+
+{
+ my $sym;
+
+ sub _locking_hash_tie {
+ my ($file_prefix,$namespace,$how,$loghead,$what) = @_;
+ my $lock_type=LOCK_SH;
+# Are we reading or writing?
+ if ($how eq &GDBM_READER()) {
+# We are reading
+ if (!open($sym,"$file_prefix.db.lock")) {
+# We don't have a lock file. This could mean
+# - that there is no such db-file
+# - that it does not have a lock file yet
+ if ((! -e "$file_prefix.db") && (! -e "$file_prefix.db.gz")) {
+# No such file. Forget it.
+ $! = 2;
+ return undef;
+ }
+# Apparently just no lock file yet. Make one
+ open($sym,">>$file_prefix.db.lock");
+ }
+# Do a shared lock
+ if (!&flock_sym(LOCK_SH)) { return undef; }
+# If this is compressed, we will actually need an exclusive lock
+ if (-e "$file_prefix.db.gz") {
+ if (!&flock_sym(LOCK_EX)) { return undef; }
+ }
+ } elsif ($how eq &GDBM_WRCREAT()) {
+# We are writing
+ open($sym,">>$file_prefix.db.lock");
+# Writing needs exclusive lock
+ if (!&flock_sym(LOCK_EX)) { return undef; }
+ } else {
+ &logthis("Unknown method $how for $file_prefix");
+ die();
+ }
+# The file is ours!
+# If it is archived, un-archive it now
+ if (-e "$file_prefix.db.gz") {
+ system("gunzip $file_prefix.db.gz");
+ if (-e "$file_prefix.hist.gz") {
+ system("gunzip $file_prefix.hist.gz");
+ }
+ }
+# Change access mode to non-blocking
+ $how=$how|&GDBM_NOLOCK();
+# Go ahead and tie the hash
+ return &_do_hash_tie($file_prefix,$namespace,$how,$loghead,$what);
+ }
+
+ sub flock_sym {
+ my ($lock_type)=@_;
+ my $failed=0;
+ eval {
+ local $SIG{__DIE__}='DEFAULT';
+ local $SIG{ALRM}=sub {
+ $failed=1;
+ die("failed lock");
+ };
+ alarm($loncapa_max_wait_time);
+ flock($sym,$lock_type);
+ alarm(0);
+ };
+ if ($failed) {
+ $! = 100; # throwing error # 100
+ return undef;
+ } else {
+ return 1;
+ }
+ }
+
+ sub _locking_hash_untie {
+ my ($hashref) = @_;
+ my $result = untie(%$hashref);
+ flock($sym,LOCK_UN);
+ close($sym);
+ undef($sym);
+ return $result;
+ }
+}
+
+BEGIN {
+ my $perlvarref=LONCAPA::Configuration::read_conf('loncapa.conf');
+ %perlvar=%{$perlvarref};
+ undef $perlvarref;
+}
+
1;
__END__
@@ -109,4 +321,3 @@
as needed
=back
-
Index: loncom/lonenc.pm
diff -u loncom/lonenc.pm:1.14 loncom/lonenc.pm:1.15
--- loncom/lonenc.pm:1.14 Fri Apr 7 18:15:34 2006
+++ loncom/lonenc.pm Tue May 30 08:45:12 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# URL translation for encrypted filenames
#
-# $Id: lonenc.pm,v 1.14 2006/04/07 22:15:34 albertel Exp $
+# $Id: lonenc.pm,v 1.15 2006/05/30 12:45:12 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -32,7 +32,9 @@
use Apache::lonnet;
use Crypt::IDEA;
use Time::HiRes qw(gettimeofday);
-
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
sub encryptseed {
my $seed=$env{'course.'.$env{'request.course.id'}.'.internal.encseed'};
$seed=~s/[^0-9a-f]/0/g;
@@ -49,7 +51,7 @@
unless ($seed) {
return '/'.$uri;
}
- $uri=&Apache::lonnet::unescape($uri);
+ $uri=&unescape($uri);
my $cipher=new IDEA $seed;
my $decuri='';
for (my $encidx=0;$encidx<length($uri);$encidx+=16) {
@@ -101,7 +103,7 @@
$encuri.=unpack("H16",
$cipher->encrypt(substr($uri,$encidx,8)));
}
- return '/enc/'.$cmdlength.'/'.&Apache::lonnet::escape($encuri);
+ return '/enc/'.$cmdlength.'/'.&escape($encuri);
}
sub check_encrypt {
Index: loncom/lontrans.pm
diff -u loncom/lontrans.pm:1.10 loncom/lontrans.pm:1.11
--- loncom/lontrans.pm:1.10 Mon Jan 16 14:27:09 2006
+++ loncom/lontrans.pm Tue May 30 08:45:12 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# URL translation for User Files
#
-# $Id: lontrans.pm,v 1.10 2006/01/16 19:27:09 albertel Exp $
+# $Id: lontrans.pm,v 1.11 2006/05/30 12:45:12 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -32,7 +32,9 @@
use Apache::Constants qw(:common :remotehost);
use Apache::lonnet();
use Apache::File();
-use Apache::loncommon;
+use lib '/home/httpd/lib/perl';
+use LONCAPA;
+
sub handler {
my $r = shift;
@@ -46,7 +48,7 @@
my @ids=&Apache::lonnet::current_machine_ids();
foreach my $id (@ids) { if ($id eq $chome) { $allowed=1; } }
if ($allowed) {
- $r->filename(&Apache::loncommon::propath($udom,$uname).
+ $r->filename(&propath($udom,$uname).
'/userfiles/'.(join('/',@ufile)));
}
} elsif ($r->uri=~m|^/~|) {
Index: loncom/auth/lonlogin.pm
diff -u loncom/auth/lonlogin.pm:1.74 loncom/auth/lonlogin.pm:1.75
--- loncom/auth/lonlogin.pm:1.74 Wed Apr 5 18:39:55 2006
+++ loncom/auth/lonlogin.pm Tue May 30 08:45:24 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Login Screen
#
-# $Id: lonlogin.pm,v 1.74 2006/04/05 22:39:55 albertel Exp $
+# $Id: lonlogin.pm,v 1.75 2006/05/30 12:45:24 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -37,6 +37,9 @@
use Apache::lonauth();
use Apache::lonlocal;
use Apache::migrateuser();
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
sub handler {
my $r = shift;
@@ -608,7 +611,7 @@
}
if ($showhelpdesk) {
$contactblock .= '<b> <a href="javascript:helpdesk()">'.$$lt{'helpdesk'}.'</a></b><br />';
- my $thisurl = &Apache::lonnet::escape('/adm/login');
+ my $thisurl = &escape('/adm/login');
$$helpdeskscript = <<"ENDSCRIPT";
<script type="text/javascript">
function helpdesk() {
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.148 loncom/auth/lonroles.pm:1.149
--- loncom/auth/lonroles.pm:1.148 Mon May 15 13:45:46 2006
+++ loncom/auth/lonroles.pm Tue May 30 08:45:24 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.148 2006/05/15 17:45:46 albertel Exp $
+# $Id: lonroles.pm,v 1.149 2006/05/30 12:45:24 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -40,6 +40,9 @@
use Apache::lonannounce;
use Apache::lonlocal;
use GDBM_File;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
sub redirect_user {
my ($r,$title,$url,$msg,$launch_nav) = @_;
@@ -379,7 +382,7 @@
$last=$hash{'last_known'};
untie(%hash);
}
- if ($last) { $fn.='?symb='.&Apache::lonnet::escape($last); }
+ if ($last) { $fn.='?symb='.&escape($last); }
&Apache::londocs::changewarning($r,undef,'You have modified your course recently, [_1] may fix this access problem.',
&Apache::lonenc::check_encrypt($fn));
@@ -990,7 +993,7 @@
sub recent_filename {
my $area=shift;
- return 'nohist_recent_'.&Apache::lonnet::escape($area);
+ return 'nohist_recent_'.&escape($area);
}
sub set_privileges {
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.157 loncom/homework/bridgetask.pm:1.158
--- loncom/homework/bridgetask.pm:1.157 Thu May 25 16:08:18 2006
+++ loncom/homework/bridgetask.pm Tue May 30 08:45:36 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.157 2006/05/25 20:08:18 albertel Exp $
+# $Id: bridgetask.pm,v 1.158 2006/05/30 12:45:36 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,6 +38,9 @@
use Apache::lonxml;
use Apache::slotrequest();
use Time::HiRes qw( gettimeofday tv_interval );
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
BEGIN {
&Apache::lonxml::register('Apache::bridgetask',('Task','IntroParagraph','Dimension','Question','Instance','InstanceText','Criteria','ClosingParagraph'));
@@ -263,7 +266,7 @@
}
if ($env{'request.enc'}) { $symb=&Apache::lonenc::encrypted($symb); }
- $symb=&Apache::lonnet::escape($symb);
+ $symb=&escape($symb);
$result.='<form method="post" action="/adm/slotrequest">'.
'<input type="hidden" name="symb" value="'.$symb.'" />'.
'<input type="hidden" name="command" value="'.$action.'" />'.
@@ -574,7 +577,7 @@
&Apache::lonnet::gettitle($symb).' for '.$uname.' at '.$udom.'</td></tr></table>';
$form_tag_start.=
'<input type="hidden" name="gradingkey" value="'.
- &Apache::lonnet::escape($todo).'" />';
+ &escape($todo).'" />';
$Apache::bridgetask::queue_key=$todo;
&Apache::structuretags::initialize_storage();
&Apache::lonhomework::showhash(%Apache::lonhomework::history);
@@ -705,7 +708,7 @@
my $who=&queue_key_locked($queue,$gradingkey);
if ($who eq $me) {
#already have the lock
- $env{'form.gradingkey'}=&Apache::lonnet::escape($gradingkey);
+ $env{'form.gradingkey'}=&escape($gradingkey);
return ($gradingkey);
}
@@ -730,7 +733,7 @@
$env{'form.queue'}=$queue='gradingqueue';
}
- my $gradingkey=&Apache::lonnet::unescape($env{'form.gradingkey'});
+ my $gradingkey=&unescape($env{'form.gradingkey'});
if ($env{'form.queue'} eq 'none') {
if (defined($env{'form.gradingkey'})) {
@@ -1292,7 +1295,7 @@
$slot_text = '';
}
if ($with_selects) {
- my $ekey=&Apache::lonnet::escape($key);
+ my $ekey=&escape($key);
my ($action,$description,$status)=('select',&mt('Select'));
if (exists($queue{"$key\0locked"})) {
my $me=$env{'user.name'}.':'.$env{'user.domain'};
@@ -1491,7 +1494,7 @@
sub find_mid_grade {
my ($queue,$symb,$cdom,$cnum)=@_;
- my $todo=&Apache::lonnet::unescape($env{'form.gradingkey'});
+ my $todo=&unescape($env{'form.gradingkey'});
my $me=$env{'user.name'}.':'.$env{'user.domain'};
if ($todo) {
my $who=&queue_key_locked($queue,$todo,$cdom,$cnum);
@@ -1663,7 +1666,7 @@
}
}
my $todo =
- &Apache::lonnet::escape(&encode_queue_key($symb,$udom,$uname));
+ &escape(&encode_queue_key($symb,$udom,$uname));
if ($cannot_grade) {
$result.='<tr><td> </td><td>'.$classlist->{$student}[&Apache::loncoursedata::CL_FULLNAME()].
'</td><td>';
Index: loncom/homework/chemresponse.pm
diff -u loncom/homework/chemresponse.pm:1.65 loncom/homework/chemresponse.pm:1.66
--- loncom/homework/chemresponse.pm:1.65 Thu Apr 13 14:57:51 2006
+++ loncom/homework/chemresponse.pm Tue May 30 08:45:36 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# chemical equation style response
#
-# $Id: chemresponse.pm,v 1.65 2006/04/13 18:57:51 albertel Exp $
+# $Id: chemresponse.pm,v 1.66 2006/05/30 12:45:36 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -31,6 +31,9 @@
use Apache::lonxml;
use Apache::lonnet;
use Apache::lonlocal;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
BEGIN {
&Apache::lonxml::register('Apache::chemresponse',('organicresponse','organicstructure','reactionresponse','chem'));
@@ -174,7 +177,7 @@
if ($options =~ /border/) { $result.= ' border="1"'; }
$result.=' />';
&Apache::lonnet::appenv('cgi.'.$id.'.JME' =>
- &Apache::lonnet::escape($jme),
+ &escape($jme),
'cgi.'.$id.'.PNG' => 1,
'cgi.'.$id.'.WIDTH' => $width);
return $result;
@@ -333,7 +336,7 @@
if ($options =~ /border/) { $result.= ' border="1"'; }
$result.=' />';
&Apache::lonnet::appenv(
- 'cgi.'.$id.'.JME' => &Apache::lonnet::escape($molecule),
+ 'cgi.'.$id.'.JME' => &escape($molecule),
'cgi.'.$id.'.PNG' => 1,
'cgi.'.$id.'.WIDTH' => $width );
} elsif ($target eq 'tex') {
@@ -349,10 +352,10 @@
'_'.time.'_'.$$.int(rand(1000)).'_organicstructure';
my $id=$filename;
&Apache::lonnet::appenv(
- 'cgi.'.$id.'.JME' => &Apache::lonnet::escape($molecule),
+ 'cgi.'.$id.'.JME' => &escape($molecule),
'cgi.'.$id.'.PS' => 1,
'cgi.'.$id.'.WIDTH' => $texwidth );
- $id=&Apache::lonnet::escape($id);
+ $id=&escape($id);
&Apache::lonxml::register_ssi("/cgi-bin/convertjme.pl?$id");
if ($options =~ /border/) { $result.= '\fbox{'; }
$result .= '\graphicspath{{/home/httpd/perl/tmp/}}\includegraphics[width='.$texwidth.' mm]{'.$filename.'.eps}';
@@ -401,9 +404,9 @@
sub edit_reaction_button {
my ($id,$field,$reaction)=@_;
- my $id_es=&Apache::lonnet::escape($id);
- my $field_es=&Apache::lonnet::escape($field);
- my $reaction_es=&Apache::lonnet::escape($reaction);
+ my $id_es=&escape($id);
+ my $field_es=&escape($field);
+ my $reaction_es=&escape($reaction);
my $docopen=&Apache::lonhtmlcommon::javascript_docopen();
my $start_page =
&Apache::loncommon::start_page('LON-CAPA Reaction Editor',undef,
Index: loncom/homework/drawimage.pm
diff -u loncom/homework/drawimage.pm:1.8 loncom/homework/drawimage.pm:1.9
--- loncom/homework/drawimage.pm:1.8 Thu Sep 9 03:34:48 2004
+++ loncom/homework/drawimage.pm Tue May 30 08:45:36 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# programatic image drawing
#
-# $Id: drawimage.pm,v 1.8 2004/09/09 07:34:48 albertel Exp $
+# $Id: drawimage.pm,v 1.9 2006/05/30 12:45:36 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -29,6 +29,9 @@
package Apache::drawimage;
use strict;
use Apache::loncommon;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
my %args;
my $cgi_id;
@@ -96,7 +99,7 @@
my $color = &Apache::lonxml::get_param('color',$parstack,$safeeval);
my $direction = &Apache::lonxml::get_param('direction',$parstack,$safeeval);
my $text = &Apache::lonxml::endredirection();
- $text = &Apache::lonnet::escape($text);
+ $text = &escape($text);
$args{"cgi.$cgi_id.OBJTYPE"}.='LABEL:';
my $i=$args{"cgi.$cgi_id.OBJCOUNT"}++;
$args{"cgi.$cgi_id.OBJ$i"}=join(':',($x,$y,$text,$font,$color,$direction));
@@ -280,7 +283,7 @@
my $i=$args{"cgi.$cgi_id.OBJCOUNT"}++;
$args{"cgi.$cgi_id.OBJTYPE"}.='IMAGE:';
$args{"cgi.$cgi_id.OBJ$i"} =
- join(':',($x,$y,&Apache::lonnet::escape($bgimg),$transparent,
+ join(':',($x,$y,&escape($bgimg),$transparent,
$clipx,$clipy,$scaledwidth,$scaledheight,$clipwidth,$clipheight));
}
return $result;
Index: loncom/homework/edit.pm
diff -u loncom/homework/edit.pm:1.101 loncom/homework/edit.pm:1.102
--- loncom/homework/edit.pm:1.101 Tue Apr 18 18:36:23 2006
+++ loncom/homework/edit.pm Tue May 30 08:45:36 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# edit mode helpers
#
-# $Id: edit.pm,v 1.101 2006/04/18 22:36:23 albertel Exp $
+# $Id: edit.pm,v 1.102 2006/05/30 12:45:36 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -32,6 +32,9 @@
use Apache::lonnet;
use HTML::Entities();
use Apache::lonlocal;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
# Global Vars
# default list of colors to use in editing
@@ -799,13 +802,13 @@
unless ($Apache::edit::bgimgsrc) { return ''; }
if ($idx) { $idx.='_'; }
if ($idy) { $idy.='_'; }
- my $bgfile=&Apache::lonnet::escape(&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$Apache::edit::bgimgsrc));
+ my $bgfile=&escape(&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$Apache::edit::bgimgsrc));
my $form = 'lonhomework';
my $element;
if (! defined($mode) || $mode eq 'attribute') {
- $element = &Apache::lonnet::escape("$Apache::lonxml::curdepth");
+ $element = &escape("$Apache::lonxml::curdepth");
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag>
- $element = &Apache::lonnet::escape('homework_edit_'.
+ $element = &escape('homework_edit_'.
$Apache::lonxml::curdepth);
}
my $id=$Apache::lonxml::curdepth;
@@ -834,13 +837,13 @@
sub entercoord {
my ($idx,$mode,$width,$height,$type) = @_;
unless ($Apache::edit::bgimgsrc) { return ''; }
- my $bgfile=&Apache::lonnet::escape(&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$Apache::edit::bgimgsrc));
+ my $bgfile=&escape(&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$Apache::edit::bgimgsrc));
my $form = 'lonhomework';
my $element;
if (! defined($mode) || $mode eq 'attribute') {
- $element = &Apache::lonnet::escape("$idx\_$Apache::lonxml::curdepth");
+ $element = &escape("$idx\_$Apache::lonxml::curdepth");
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag>
- $element = &Apache::lonnet::escape('homework_edit_'.
+ $element = &escape('homework_edit_'.
$Apache::lonxml::curdepth);
}
my $id=$Apache::lonxml::curdepth;
@@ -874,14 +877,14 @@
my $form = 'lonhomework';
my $element;
if (! defined($mode) || $mode eq 'attribute') {
- $element = &Apache::lonnet::escape("$id\_$Apache::lonxml::curdepth");
+ $element = &escape("$id\_$Apache::lonxml::curdepth");
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag>
- $element = &Apache::lonnet::escape('homework_edit_'.
+ $element = &escape('homework_edit_'.
$Apache::lonxml::curdepth);
}
my $titleelement;
if ($titleid) {
- $titleelement=",'','','".&Apache::lonnet::escape("$titleid\_$Apache::lonxml::curdepth")."'";
+ $titleelement=",'','','".&escape("$titleid\_$Apache::lonxml::curdepth")."'";
}
my $result = <<"ENDBUTTON";
<a href=\"javascript:openbrowser('$form','$element'$titleelement)\"\>Select</a>
@@ -896,14 +899,14 @@
my $form = 'lonhomework';
my $element;
if (! defined($mode) || $mode eq 'attribute') {
- $element = &Apache::lonnet::escape("$id\_$Apache::lonxml::curdepth");
+ $element = &escape("$id\_$Apache::lonxml::curdepth");
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag>
- $element = &Apache::lonnet::escape('homework_edit_'.
+ $element = &escape('homework_edit_'.
$Apache::lonxml::curdepth);
}
my $titleelement;
if ($titleid) {
- $titleelement=",'".&Apache::lonnet::escape("$titleid\_$Apache::lonxml::curdepth")."'";
+ $titleelement=",'".&escape("$titleid\_$Apache::lonxml::curdepth")."'";
}
my $result = <<"ENDBUTTON";
<a href=\"javascript:opensearcher('$form','$element'$titleelement)\"\>Search</a>
Index: loncom/homework/essayresponse.pm
diff -u loncom/homework/essayresponse.pm:1.71 loncom/homework/essayresponse.pm:1.72
--- loncom/homework/essayresponse.pm:1.71 Wed Mar 8 20:11:12 2006
+++ loncom/homework/essayresponse.pm Tue May 30 08:45:36 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# essay (ungraded) style responses
#
-# $Id: essayresponse.pm,v 1.71 2006/03/09 01:11:12 albertel Exp $
+# $Id: essayresponse.pm,v 1.72 2006/05/30 12:45:36 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -31,6 +31,9 @@
use Apache::lonxml();
use Apache::lonnet;
use Apache::lonlocal;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
BEGIN {
&Apache::lonxml::register('Apache::essayresponse',('essayresponse'));
@@ -119,7 +122,7 @@
&Apache::lonnet::declutter($ENV{'REQUEST_URI'});
my ($adom,$aname,$apath)=
($essayurl=~/^(\w+)\/(\w+)\/(.*)$/);
- $apath=&Apache::lonnet::escape($apath);
+ $apath=&escape($apath);
$apath=~s/\W/\_/gs;
&Apache::lonnet::put('nohist_essay_'.$apath,
{ $akey => $response },$adom,$aname);
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.358 loncom/homework/grades.pm:1.359
--- loncom/homework/grades.pm:1.358 Mon May 29 20:15:04 2006
+++ loncom/homework/grades.pm Tue May 30 08:45:36 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.358 2006/05/30 00:15:04 banghart Exp $
+# $Id: grades.pm,v 1.359 2006/05/30 12:45:36 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -40,6 +40,9 @@
use Apache::Constants qw(:common);
use Apache::lonlocal;
use String::Similarity;
+use lib '/home/httpd/lib/perl';
+use LONCAPA;
+
use POSIX qw(floor);
my %oldessays=();
@@ -1747,7 +1750,7 @@
#
my (undef,undef,$essayurl) = &Apache::lonnet::decode_symb($symb);
my ($adom,$aname,$apath)=($essayurl=~/^(\w+)\/(\w+)\/(.*)$/);
- $apath=&Apache::lonnet::escape($apath);
+ $apath=&escape($apath);
$apath=~s/\W/\_/gs;
%oldessays=&Apache::lonnet::dump('nohist_essay_'.$apath,$adom,$aname);
}
@@ -2427,10 +2430,8 @@
sub handback_files {
my ($request,$symb,$stuname,$domain,$newflg,$new_part,$newrecord) = @_;
- my $portfolio_root = &Apache::loncommon::propath($domain,
- $stuname).
- '/userfiles/portfolio';
- my ($partlist,$handgrade,$responseType) = &response_type($symb);
+ my $portfolio_root = &propath($domain,$stuname).'/userfiles/portfolio';
+ my ($partlist,$handgrade,$responseType) = &response_type($symb);
foreach my $part_resp (sort(keys(%$handgrade))) {
my ($part_id, $resp_id) = split(/_/,$part_resp);
if (($env{'form.'.$newflg.'_'.$part_resp.'_returndoc1'}) && ($new_part == $part_id)) {
@@ -2555,9 +2556,8 @@
my $version_parts = join('|',@$v_flag);
my @returned_keys;
my $parts = join('|', @$parts_graded);
- my $portfolio_root = &Apache::loncommon::propath($domain,
- $stu_name).
- '/userfiles/portfolio';
+ my $portfolio_root = &propath($domain,$stu_name).
+ '/userfiles/portfolio';
foreach my $key (keys(%$record)) {
my $new_portfiles;
if ($key =~ /^resource\.($version_parts)\./ && $key =~ /\.portfiles$/ ) {
@@ -4228,7 +4228,7 @@
my $cdom=$env{'course.'.$env{'request.course.id'}.'.domain'};
my $cname=$env{'course.'.$env{'request.course.id'}.'.num'};
my @files=&Apache::lonnet::dirlist('userfiles',$cdom,$cname,
- &Apache::loncommon::propath($cdom,$cname));
+ &propath($cdom,$cname));
my @possiblenames;
foreach my $filename (sort(@files)) {
($filename)=split(/&/,$filename);
@@ -5256,11 +5256,11 @@
</script>
ENDSCRIPT
my $href="/adm/pickcode?".
- "form=".&Apache::lonnet::escape("scantronupload").
- "&scantron_format=".&Apache::lonnet::escape($env{'form.scantron_format'}).
- "&scantron_CODElist=".&Apache::lonnet::escape($env{'form.scantron_CODElist'}).
- "&curCODE=".&Apache::lonnet::escape($$scan_record{'scantron.CODE'}).
- "&scantron_selectfile=".&Apache::lonnet::escape($env{'form.scantron_selectfile'});
+ "form=".&escape("scantronupload").
+ "&scantron_format=".&escape($env{'form.scantron_format'}).
+ "&scantron_CODElist=".&escape($env{'form.scantron_CODElist'}).
+ "&curCODE=".&escape($$scan_record{'scantron.CODE'}).
+ "&scantron_selectfile=".&escape($env{'form.scantron_selectfile'});
if ($env{'form.scantron_CODElist'} =~ /\S/) {
$r->print("<label><input type='radio' name='scantron_CODE_resolution' value='use_found' /> <a target='_blank' href='$href'>Select</a> a CODE from the list of all CODEs and use it.</label> Selected CODE is <input readonly='true' type='text' size='8' name='scantron_CODE_selectedvalue' onfocus=\"javascript:change_radio('use_found')\" onchange=\"javascript:change_radio('use_found')\" />");
$r->print("\n<br />");
Index: loncom/homework/imagechoice.pm
diff -u loncom/homework/imagechoice.pm:1.10 loncom/homework/imagechoice.pm:1.11
--- loncom/homework/imagechoice.pm:1.10 Thu Apr 13 14:49:29 2006
+++ loncom/homework/imagechoice.pm Tue May 30 08:45:37 2006
@@ -1,4 +1,4 @@
-# $Id: imagechoice.pm,v 1.10 2006/04/13 18:49:29 albertel Exp $
+# $Id: imagechoice.pm,v 1.11 2006/05/30 12:45:37 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -26,6 +26,9 @@
use strict;
use Apache::Constants qw(:common :http);
use Apache::lonnet;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
sub deletedata {
my ($id)=@_;
@@ -245,7 +248,7 @@
$r->send_http_header;
my %data;
my (undef,$id) = split(/=/,$ENV{'QUERY_STRING'});
- my $filename = &Apache::lonnet::unescape($env{"imagechoice.$id.file"});
+ my $filename = &unescape($env{"imagechoice.$id.file"});
my $formname = $env{"imagechoice.$id.formname"};
if ($env{'form.cancel'} eq 'Cancel') {
&deletedata($id);
Index: loncom/homework/imageresponse.pm
diff -u loncom/homework/imageresponse.pm:1.77 loncom/homework/imageresponse.pm:1.78
--- loncom/homework/imageresponse.pm:1.77 Thu May 18 18:02:03 2006
+++ loncom/homework/imageresponse.pm Tue May 30 08:45:37 2006
@@ -2,7 +2,7 @@
# The LearningOnline Network with CAPA
# image click response style
#
-# $Id: imageresponse.pm,v 1.77 2006/05/18 22:02:03 albertel Exp $
+# $Id: imageresponse.pm,v 1.78 2006/05/30 12:45:37 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -37,6 +37,9 @@
use Apache::Constants qw(:common :http);
use Apache::lonlocal;
use Apache::lonnet;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
BEGIN {
&Apache::lonxml::register('Apache::imageresponse',('imageresponse'));
@@ -131,7 +134,7 @@
my $respid=$Apache::inputtags::response['-1'];
my $id=&Apache::loncommon::get_cgi_id();
my (%x,$i);
- $x{"cgi.$id.BGIMG"}=&Apache::lonnet::escape($image);
+ $x{"cgi.$id.BGIMG"}=&escape($image);
my ($x,$y)=split(/:/,$Apache::lonhomework::history{"resource.$part.$respid.submission"});
#draws 2 xs on the image at the clicked location
#one in white and then one in red on top of the one in white
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.191 loncom/homework/inputtags.pm:1.192
--- loncom/homework/inputtags.pm:1.191 Tue Apr 18 18:36:23 2006
+++ loncom/homework/inputtags.pm Tue May 30 08:45:37 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.191 2006/04/18 22:36:23 albertel Exp $
+# $Id: inputtags.pm,v 1.192 2006/05/30 12:45:37 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -31,6 +31,9 @@
use Apache::loncommon;
use Apache::lonlocal;
use Apache::lonnet;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
BEGIN {
&Apache::lonxml::register('Apache::inputtags',('hiddenline','textfield','textline'));
@@ -431,7 +434,7 @@
'<br />';
if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}=~/[^\s]/){
my (@filelist,@bad_file_list);
- foreach my $file (split(',',&Apache::lonnet::unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) {
+ foreach my $file (split(',',&unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) {
my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();
my $url="/uploaded/$domain/$user/portfolio$file";
my $icon=&Apache::loncommon::icon($url);
Index: loncom/homework/lonsimpleproblemedit.pm
diff -u loncom/homework/lonsimpleproblemedit.pm:1.17 loncom/homework/lonsimpleproblemedit.pm:1.18
--- loncom/homework/lonsimpleproblemedit.pm:1.17 Mon Apr 10 18:47:29 2006
+++ loncom/homework/lonsimpleproblemedit.pm Tue May 30 08:45:37 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Simple Problem Parameter Setting "Editor"
#
-# $Id: lonsimpleproblemedit.pm,v 1.17 2006/04/10 22:47:29 albertel Exp $
+# $Id: lonsimpleproblemedit.pm,v 1.18 2006/05/30 12:45:37 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -34,6 +34,9 @@
use Apache::lonnet;
use Apache::lonlocal;
use Apache::lonnavmaps;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
my %qparms;
my $prefix;
@@ -146,7 +149,7 @@
}
my ($src,$symb,$anchor)=&Apache::lonnavmaps::getLinkForResource($it->getStack());
if (defined($anchor)) { $anchor='#'.$anchor; }
- return $src.'?symb='.&Apache::lonnet::escape($symb).$anchor;
+ return $src.'?symb='.&escape($symb).$anchor;
}
sub handler {
Index: loncom/homework/randomlabel.pm
diff -u loncom/homework/randomlabel.pm:1.81 loncom/homework/randomlabel.pm:1.82
--- loncom/homework/randomlabel.pm:1.81 Thu Dec 1 13:46:31 2005
+++ loncom/homework/randomlabel.pm Tue May 30 08:45:37 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# random labelling tool
#
-# $Id: randomlabel.pm,v 1.81 2005/12/01 18:46:31 albertel Exp $
+# $Id: randomlabel.pm,v 1.82 2006/05/30 12:45:37 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -61,6 +61,9 @@
use Apache::Constants qw(:common :http);
use Image::Magick;
use Apache::lonplot;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
my %args;
my $cgi_id;
@@ -138,7 +141,7 @@
if ($target eq 'web') {
$cgi_id=&Apache::loncommon::get_cgi_id();
%args=();
- $args{"cgi.$cgi_id.BGIMG"}=&Apache::lonnet::escape($bgimg);
+ $args{"cgi.$cgi_id.BGIMG"}=&escape($bgimg);
$height_param = &Apache::lonxml::get_param('height',$parstack, $safeeval);
$width_param = &Apache::lonxml::get_param('width', $parstack, $safeeval);
} elsif ($target eq 'tex' && defined($bgimg)) {
@@ -223,7 +226,7 @@
&Apache::lonxml::debug("Image: $bgimg");
$bgimg=&Apache::imageresponse::clean_up_image($bgimg);
&Apache::lonxml::debug("Cleaned image: $bgimg");
- $args{"cgi.$cgi_id.BGIMG"}=&Apache::lonnet::escape($bgimg);
+ $args{"cgi.$cgi_id.BGIMG"}=&escape($bgimg);
} elsif ($target eq 'tex') {
# Some bg images can create latex for us... e.g. gnuplot.
# If it looks like we have some latex use that,
@@ -422,13 +425,13 @@
my $i=$Apache::randomlabel::obj_cnt++;
if( $type eq 'text') {
&add_vars($gname,$_,$label,$idx_arr[$_],$value,'',$safeeval);
- $str = join(':',$x,$y,&Apache::lonnet::escape($label));
+ $str = join(':',$x,$y,&escape($label));
$args{"cgi.$cgi_id.OBJTYPE"}.='LABEL:';
} elsif ( $type eq 'image') {
&add_vars($gname,$_,
$Apache::randomlabel::description[$idx_arr[$_]],
$idx_arr[$_],$value,$label,$safeeval);
- $str = join(':',$x,$y,&Apache::lonnet::escape($label));
+ $str = join(':',$x,$y,&escape($label));
$args{"cgi.$cgi_id.OBJTYPE"}.='IMAGE:';
} else {
&Apache::lonxml::error('Unknown type of label :'.$type.':');
Index: loncom/homework/randomlylabel.pm
diff -u loncom/homework/randomlylabel.pm:1.27 loncom/homework/randomlylabel.pm:1.28
--- loncom/homework/randomlylabel.pm:1.27 Tue Nov 15 15:46:27 2005
+++ loncom/homework/randomlylabel.pm Tue May 30 08:45:37 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# randomlabel.png: composite together text and images into 1 image
#
-# $Id: randomlylabel.pm,v 1.27 2005/11/15 20:46:27 albertel Exp $
+# $Id: randomlylabel.pm,v 1.28 2006/05/30 12:45:37 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -205,6 +205,9 @@
use GD::Polyline();
use LWP::UserAgent();
use Apache::lonnet;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
sub get_image {
my ($imgsrc,$set_trans)=@_;
@@ -276,7 +279,7 @@
$prefix='form.';
}
if (defined($env{$prefix."BGIMG"})) {
- my $bgimg=&Apache::lonnet::unescape($env{$prefix."BGIMG"});
+ my $bgimg=&unescape($env{$prefix."BGIMG"});
#&Apache::lonnet::logthis("BGIMG is ".$bgimg);
$image=&get_image($bgimg,0);
if (! defined($image)) {
@@ -371,7 +374,7 @@
} elsif ($type eq 'IMAGE') {
my ($x,$y,$file,$transparent,$srcX,$srcY,$destW,$destH,$srcW,
$srcH)=split(':',$env{$prefix."OBJ$i"});
- $file=&Apache::lonnet::unescape($file);
+ $file=&unescape($file);
if (!defined($transparent)) { $transparent=1; }
my $subimage=&get_image($file,$transparent);
if (!defined($subimage)) {
@@ -388,7 +391,7 @@
} elsif ($type eq 'LABEL') {
my ($x,$y,$text,$font,$color,$direction)=
split(':',$env{$prefix."OBJ$i"});
- $text=&Apache::lonnet::unescape($text);
+ $text=&unescape($text);
my $imcolor=&get_color_from_hexstring($image,$color);
my $type='normal';
my ($height,$fontref);
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.355 loncom/homework/structuretags.pm:1.356
--- loncom/homework/structuretags.pm:1.355 Tue May 23 15:05:42 2006
+++ loncom/homework/structuretags.pm Tue May 30 08:45:37 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.355 2006/05/23 19:05:42 albertel Exp $
+# $Id: structuretags.pm,v 1.356 2006/05/30 12:45:37 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,6 +38,9 @@
use Apache::lonxml;
use Apache::lonenc();
use Time::HiRes qw( gettimeofday tv_interval );
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
BEGIN {
&Apache::lonxml::register('Apache::structuretags',('block','languageblock','instructorcomment','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','problemtype','startouttext','endouttext','simpleeditbutton','definetag'));
}
@@ -1380,7 +1383,7 @@
}
if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { $result .= '\fbox{\textit{'.$weight.' pt}}';}
} elsif ($target eq 'web') {
- $result.='<a name="'.&Apache::lonnet::escape($Apache::inputtags::part).'" />';
+ $result.='<a name="'.&escape($Apache::inputtags::part).'" />';
}
}
}
@@ -1633,7 +1636,7 @@
$url=~s/\?.*$//;
my ($symb) = &Apache::lonxml::whichuser();
$result='<table width="100%" bgcolor="#FFFFAA" border="2"><tr><td>'.
- '<a href="'.$url.'/smpedit?symb='.&Apache::lonnet::escape($symb).'">'.&mt('Edit').'</a> - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.').
+ '<a href="'.$url.'/smpedit?symb='.&escape($symb).'">'.&mt('Edit').'</a> - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.').
&Apache::loncommon::help_open_topic('Caching').'</td></tr></table><br />';
}
return $result;
Index: loncom/imspackages/imsexport.pm
diff -u loncom/imspackages/imsexport.pm:1.3 loncom/imspackages/imsexport.pm:1.4
--- loncom/imspackages/imsexport.pm:1.3 Thu Apr 7 02:56:22 2005
+++ loncom/imspackages/imsexport.pm Tue May 30 08:45:50 2006
@@ -152,7 +152,7 @@
my ($symb,$title) = @_;
my $output;
if ($symb =~ m-\.sequence___\d+___ext(.+)$-) {
- my $exturl = &Apache::lonnet::unescape($1);
+ my $exturl = &unescape($1);
$output = qq|
<html>
<head><title>$title</title>
Index: loncom/imspackages/imsimportdocs.pm
diff -u loncom/imspackages/imsimportdocs.pm:1.17 loncom/imspackages/imsimportdocs.pm:1.18
--- loncom/imspackages/imsimportdocs.pm:1.17 Fri Mar 24 12:36:27 2006
+++ loncom/imspackages/imsimportdocs.pm Tue May 30 08:45:50 2006
@@ -1,3 +1,7 @@
+# The LearningOnline Network with CAPA
+#
+# $Id: imsimportdocs.pm,v 1.18 2006/05/30 12:45:50 www Exp $
+#
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -30,6 +34,9 @@
use Apache::lonlocal;
use Apache::imsprocessor;
use LONCAPA::Configuration;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
use strict;
sub jscript_one {
@@ -150,7 +157,7 @@
my $uname=$env{'user.name'};
my $udom=$env{'user.domain'};
- my $plainname=&Apache::lonnet::escape(
+ my $plainname=&escape(
&Apache::loncommon::plainname($uname,$udom));
# does this user have privileges to post, etc?
@@ -631,13 +638,13 @@
my @imports = ();
if ($toplevel eq 'oldfolder') {
for (my $i=0; $i<@topurls; $i++) {
- my $url = &Apache::lonnet::unescape($topurls[$i]);
- my $name = &Apache::lonnet::unescape($topnames[$i]);
+ my $url = &unescape($topurls[$i]);
+ my $name = &unescape($topnames[$i]);
push @imports, $name, $url;
}
} elsif ($toplevel eq 'newfolder') {
- my $url = &Apache::lonnet::unescape("/uploaded/$cdom/$crs/$timenow/sequences/Top.sequence");
- my $name = &Apache::lonnet::unescape("$env{'form.foldername'}");
+ my $url = &unescape("/uploaded/$cdom/$crs/$timenow/sequences/Top.sequence");
+ my $name = &unescape("$env{'form.foldername'}");
push @imports, $name, $url;
}
my $errtext='';
Index: loncom/interface/lonchatfetch.pm
diff -u loncom/interface/lonchatfetch.pm:1.24 loncom/interface/lonchatfetch.pm:1.25
--- loncom/interface/lonchatfetch.pm:1.24 Wed May 17 21:08:50 2006
+++ loncom/interface/lonchatfetch.pm Tue May 30 08:46:08 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Chat Fetching
#
-# $Id: lonchatfetch.pm,v 1.24 2006/05/18 01:08:50 raeburn Exp $
+# $Id: lonchatfetch.pm,v 1.25 2006/05/30 12:46:08 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -34,6 +34,9 @@
use Apache::loncommon;
use Apache::lonnet;
use Apache::longroup;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
sub handler {
my $r = shift;
@@ -54,7 +57,7 @@
my %group_info =
&Apache::longroup::get_group_settings($curr_groups{$group});
$grouptitle =
- '<b>'.&Apache::lonnet::unescape($group_info{description}).
+ '<b>'.&unescape($group_info{description}).
'</b><br />';
}
} elsif (! &Apache::lonnet::allowed('pch',$env{'request.course.id'}.
@@ -107,7 +110,7 @@
}
my @participants=();
foreach (@entries) {
- my ($id,$msg,$udom)=split(/\:/,&Apache::lonnet::unescape($_));
+ my ($id,$msg,$udom)=split(/\:/,&unescape($_));
if ($id eq 'active_participant') {
chomp($udom);
my $participant= &Apache::loncommon::nickname($msg,$udom);
@@ -117,8 +120,8 @@
chomp($msg);
my ($msgtime,$msgnum)=split(/\_/,$id);
my ($sdom,$snum,$anon,$contrib)=split(/\:/,
- &Apache::lonnet::unescape($msg));
- $contrib=&Apache::lonnet::unescape($contrib);
+ &unescape($msg));
+ $contrib=&unescape($contrib);
&Apache::lonfeedback::newline_to_br(\$contrib);
($contrib,my $errors)=&Apache::lontexconvert::msgtexconverted($contrib);
if ($errors) { $contrib.="[Message not fully displayed due to incorrect embedded TeX]"; }
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.375 loncom/interface/loncommon.pm:1.376
--- loncom/interface/loncommon.pm:1.375 Wed May 17 21:08:50 2006
+++ loncom/interface/loncommon.pm Tue May 30 08:46:08 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.375 2006/05/18 01:08:50 raeburn Exp $
+# $Id: loncommon.pm,v 1.376 2006/05/30 12:46:08 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -4962,15 +4962,6 @@
############################################################
############################################################
-sub propath {
- my ($udom,$uname)=@_;
- $udom=~s/\W//g;
- $uname=~s/\W//g;
- my $subdir=$uname.'__';
- $subdir =~ s/(.)(.)(.).*/$1\/$2\/$3/;
- my $proname="$Apache::lonnet::perlvar{'lonUsersDir'}/$udom/$subdir/$uname";
- return $proname;
-}
sub icon {
my ($file)=@_;
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.172 loncom/interface/loncoursedata.pm:1.173
--- loncom/interface/loncoursedata.pm:1.172 Thu May 18 14:37:23 2006
+++ loncom/interface/loncoursedata.pm Tue May 30 08:46:09 2006
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: loncoursedata.pm,v 1.172 2006/05/18 18:37:23 albertel Exp $
+# $Id: loncoursedata.pm,v 1.173 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -56,6 +56,8 @@
use Apache::lonmysql;
use HTML::TokeParser;
use GDBM_File;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
=pod
@@ -75,7 +77,7 @@
Returns a reference to a hash as described by $values. $values is
assumed to be the result of
- join(':',map {&Apache::lonnet::escape($_)} %orighash);
+ join(':',map {&escape($_)} %orighash);
This is a helper function for get_current_state.
@@ -85,8 +87,7 @@
################################################
sub make_into_hash {
my $values = shift;
- my %tmp = map { &Apache::lonnet::unescape($_); }
- split(':',$values);
+ my %tmp = map { &unescape($_); } split(':',$values);
return \%tmp;
}
Index: loncom/interface/loncoursegroups.pm
diff -u loncom/interface/loncoursegroups.pm:1.23 loncom/interface/loncoursegroups.pm:1.24
--- loncom/interface/loncoursegroups.pm:1.23 Fri May 26 07:10:13 2006
+++ loncom/interface/loncoursegroups.pm Tue May 30 08:46:09 2006
@@ -1,3 +1,6 @@
+# The LearningOnline Network with CAPA
+#
+# $Id: loncoursegroups.pm,v 1.24 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -32,6 +35,8 @@
use Apache::lonnavmaps;
use Apache::longroup;
use Apache::Constants qw(:common :http);
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
sub handler {
my ($r) = @_;
@@ -235,7 +240,7 @@
$rowColor = $rowColor2;
}
my $description =
- &Apache::lonnet::unescape($grp_info{$group}{'description'});
+ &unescape($grp_info{$group}{'description'});
my $creator = $grp_info{$group}{'creator'};
my $creation = $grp_info{$group}{'creation'};
my $modified = $grp_info{$group}{'modified'};
@@ -300,7 +305,7 @@
foreach my $group (@coursegroups) {
my %group_info = &Apache::longroup::get_group_settings(
$curr_groups{$group});
- my $description = &Apache::lonnet::unescape(
+ my $description = &unescape(
$group_info{description});
my ($uname,$udom) = split(/:/,$group_info{creator});
$r->print('<font size="+1"><a href="/adm/'.$udom.'/'.$uname.'/'.$group.'/grppg">'.$group,'</a><font><br /><small>'.$description.'</small><br /><br />');
@@ -867,7 +872,7 @@
my %stored;
$stored{'description'} =
- &Apache::lonnet::unescape($groupinfo{'description'});
+ &unescape($groupinfo{'description'});
$stored{'startdate'} = $groupinfo{'startdate'};
$stored{'enddate'} = $groupinfo{'enddate'};
if ($stored{'enddate'} == 0) {
@@ -2861,7 +2866,7 @@
$creation = $$stored{'creation'};
$creator = $$stored{'creator'};
}
- my $esc_description = &Apache::lonnet::escape($description);
+ my $esc_description = &escape($description);
my @single_attributes = ('description','functions','startdate','enddate',
'creation','modified','creator','granularity',
'specificity','autoadd','autodrop');
@@ -3450,7 +3455,7 @@
sub create_homepage {
my ($cdom,$cnum,$name,$groupinfo,$tools) = @_;
my $functionality = join(',',@{$tools});
- my $content = &Apache::lonnet::unescape($$groupinfo{description});
+ my $content = &unescape($$groupinfo{description});
$content=~s/\s+$//s;
$content=~s/^\s+//s;
$content=~s/\<br\s*\/*\>$//s;
Index: loncom/interface/loncreatecourse.pm
diff -u loncom/interface/loncreatecourse.pm:1.88 loncom/interface/loncreatecourse.pm:1.89
--- loncom/interface/loncreatecourse.pm:1.88 Mon May 15 15:11:40 2006
+++ loncom/interface/loncreatecourse.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Create a course
#
-# $Id: loncreatecourse.pm,v 1.88 2006/05/15 19:11:40 albertel Exp $
+# $Id: loncreatecourse.pm,v 1.89 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,6 +38,7 @@
use Apache::lonlocal;
use Apache::londropadd;
use lib '/home/httpd/lib/perl';
+use LONCAPA;
# ================================================ Get course directory listing
@@ -57,7 +58,7 @@
my %crsdata=&Apache::lonnet::coursedescription($courseid);
my @listing=&Apache::lonnet::dirlist
($which,$crsdata{'domain'},$crsdata{'num'},
- &Apache::loncommon::propath($crsdata{'domain'},$crsdata{'num'}));
+ &propath($crsdata{'domain'},$crsdata{'num'}));
foreach (@listing) {
unless ($_=~/^\./) {
my @unpackline = split (/\&/,$_);
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.117 loncom/interface/loncreateuser.pm:1.118
--- loncom/interface/loncreateuser.pm:1.117 Wed May 17 21:08:51 2006
+++ loncom/interface/loncreateuser.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.117 2006/05/18 01:08:51 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.118 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -65,6 +65,8 @@
use Apache::loncommon;
use Apache::lonlocal;
use Apache::longroup;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
my $loginscript; # piece of javascript used in two separate instances
my $generalrule;
@@ -1226,9 +1228,9 @@
&Apache::lonnet::critical('put:'.
$env{'course.'.$cid.'.domain'}.':'.
$env{'course.'.$cid.'.num'}.':classlist:'.
- &Apache::lonnet::escape($env{'form.ccuname'}.':'.
+ &escape($env{'form.ccuname'}.':'.
$env{'form.ccdomain'}).'='.
- &Apache::lonnet::escape($now.':'),
+ &escape($now.':'),
$env{'course.'.$cid.'.home'}).'</b><br />');
}
}
@@ -1253,9 +1255,9 @@
&Apache::lonnet::critical('put:'.
$env{'course.'.$cid.'.domain'}.':'.
$env{'course.'.$cid.'.num'}.':classlist:'.
- &Apache::lonnet::escape($env{'form.ccuname'}.':'.
+ &escape($env{'form.ccuname'}.':'.
$env{'form.ccdomain'}).'='.
- &Apache::lonnet::escape($now.':'),
+ &escape($now.':'),
$env{'course.'.$cid.'.home'}).'</b><br />');
}
}
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.227 loncom/interface/londocs.pm:1.228
--- loncom/interface/londocs.pm:1.227 Fri May 12 12:47:35 2006
+++ loncom/interface/londocs.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.227 2006/05/12 16:47:35 albertel Exp $
+# $Id: londocs.pm,v 1.228 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,6 +42,8 @@
use GDBM_File;
use Apache::lonlocal;
use Cwd;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
my $iconpath;
@@ -950,9 +952,9 @@
if ($env{'form.markedcopy_url'}) {
&Apache::lonnet::logthis('Found '.$env{'form.markedcopy_url'});
$cpinfo='&markedcopy_url='.
- &Apache::lonnet::escape($env{'form.markedcopy_url'}).
+ &escape($env{'form.markedcopy_url'}).
'&markedcopy_title='.
- &Apache::lonnet::escape($env{'form.markedcopy_title'});
+ &escape($env{'form.markedcopy_title'});
}
while (@folders) {
my $folder=shift(@folders);
@@ -960,12 +962,12 @@
if ($folderpath) {$folderpath.='&';}
$folderpath.=$folder.'&'.$foldername;
my $url='/adm/coursedocs?folderpath='.
- &Apache::lonnet::escape($folderpath);
+ &escape($folderpath);
&Apache::lonhtmlcommon::add_breadcrumb(
{'href'=>$url.$cpinfo,
- 'title'=>&Apache::lonnet::unescape($foldername),
+ 'title'=>&unescape($foldername),
'text'=>'<font size="+1">'.
- &Apache::lonnet::unescape($foldername).'</font>'
+ &unescape($foldername).'</font>'
});
@@ -1170,8 +1172,8 @@
foreach (split(/\&/,$env{'form.importdetail'})) {
if (defined($_)) {
my ($name,$url)=split(/\=/,$_);
- $name=&Apache::lonnet::unescape($name);
- $url=&Apache::lonnet::unescape($url);
+ $name=&unescape($name);
+ $url=&unescape($url);
push @imports, $name, $url;
}
}
@@ -1324,14 +1326,14 @@
method="post" enctype="multipart/form-data">
<input type="hidden" name="folderpath" value="'.$env{'form.folderpath'}.'" /> <input type="hidden" name="cmd" value="upload_embedded" />
<input type="hidden" name="newidx" value="'.$newidx.'" />
- <input type="hidden" name="primaryurl" value="'.&Apache::lonnet::escape($url).'" />
+ <input type="hidden" name="primaryurl" value="'.&escape($url).'" />
<input type="hidden" name="phasetwo" value="'.$total_embedded.'" />';
$$upload_output .= '<b>Upload embedded files</b>:<br />
<table>';
foreach my $embed_file (keys(%{$allfiles})) {
$$upload_output .= '<tr><td>'.$embed_file.
'<input name="embedded_item_'.$num.'" type="file" />
- <input name="embedded_orig_'.$num.'" type="hidden" value="'.&Apache::lonnet::escape($embed_file).'" />';
+ <input name="embedded_orig_'.$num.'" type="hidden" value="'.&escape($embed_file).'" />';
my $attrib;
if (@{$$allfiles{$embed_file}} > 1) {
$attrib = join(':',@{$$allfiles{$embed_file}});
@@ -1342,7 +1344,7 @@
'<input name="embedded_attrib_'.$num.'" type="hidden" value="'.$attrib.'" />';
if (exists($$codebase{$embed_file})) {
$$upload_output .=
- '<input name="codebase_'.$num.'" type="hidden" value="'.&Apache::lonnet::escape($$codebase{$embed_file}).'" />';
+ '<input name="codebase_'.$num.'" type="hidden" value="'.&escape($$codebase{$embed_file}).'" />';
}
$$upload_output .= '</td></tr>';
$num ++;
@@ -1385,7 +1387,7 @@
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum)=@_;
$title=~s/\&colon\;/\:/g;
$title=&HTML::Entities::encode(&HTML::Entities::decode(
- &Apache::lonnet::unescape($title)),'"<>&\'');
+ &unescape($title)),'"<>&\'');
my $renametitle=$title;
my $foldertitle=$title;
my $pagetitle=$title;
@@ -1405,21 +1407,21 @@
my $folderpath;
if ($env{'form.folderpath'}) {
$container = 'sequence';
- $folderpath=&Apache::lonnet::escape($env{'form.folderpath'});
+ $folderpath=&escape($env{'form.folderpath'});
# $htmlfoldername=&HTML::Entities::encode($env{'form.foldername'},'<>&"');
}
my ($pagepath,$pagesymb);
if ($env{'form.pagepath'}) {
$container = 'page';
- $pagepath=&Apache::lonnet::escape($env{'form.pagepath'});
- $pagesymb=&Apache::lonnet::escape($env{'form.pagesymb'});
+ $pagepath=&escape($env{'form.pagepath'});
+ $pagesymb=&escape($env{'form.pagesymb'});
}
my $cpinfo='';
if ($env{'form.markedcopy_url'}) {
$cpinfo='&markedcopy_url='.
- &Apache::lonnet::escape($env{'form.markedcopy_url'}).
+ &escape($env{'form.markedcopy_url'}).
'&markedcopy_title='.
- &Apache::lonnet::escape($env{'form.markedcopy_title'});
+ &escape($env{'form.markedcopy_title'});
}
if ($allowed) {
my $incindex=$index+1;
@@ -1577,21 +1579,21 @@
} elsif ($url=~m|^/ext/|) {
$url='/adm/wrapper'.$url;
}
- $url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb);
+ $url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb);
if ($container eq 'page') {
my $symb=$env{'form.pagesymb'};
$url=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($symb))[2]);
- $url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb);
+ $url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb);
}
}
my $parameterset=' ';
if ($isfolder || $extension eq 'sequence') {
- my $foldername=&Apache::lonnet::escape($foldertitle);
+ my $foldername=&escape($foldertitle);
my $folderpath=$env{'form.folderpath'};
if ($folderpath) { $folderpath.='&' };
$folderpath.=$folderarg.'&'.$foldername;
- $url.='folderpath='.&Apache::lonnet::escape($folderpath).$cpinfo;
+ $url.='folderpath='.&escape($folderpath).$cpinfo;
$parameterset='<label>'.&mt('Randomly Pick: ').
'<input type="text" size="4" onChange="this.form.submit()" name="randpick_'.$orderidx.'" value="'.
(&Apache::lonratedt::getparameter($orderidx,
@@ -1601,7 +1603,7 @@
}
if ($ispage) {
- my $pagename=&Apache::lonnet::escape($pagetitle);
+ my $pagename=&escape($pagetitle);
my $pagepath;
my $folderpath=$env{'form.folderpath'};
if ($folderpath) { $pagepath = $folderpath.'&' };
@@ -1615,8 +1617,8 @@
$residx,
$path.$pagearg.'.page');
}
- $url.='pagepath='.&Apache::lonnet::escape($pagepath).
- '&pagesymb='.&Apache::lonnet::escape($symb).$cpinfo;
+ $url.='pagepath='.&escape($pagepath).
+ '&pagesymb='.&escape($symb).$cpinfo;
}
$line.='<td bgcolor="#FFFFBB"><a href="'.$url.'"><img src="'.$icon.
'" border="0"></a></td>'.
@@ -1671,7 +1673,7 @@
sub checkonthis {
my ($r,$url,$level,$title)=@_;
- $url=&Apache::lonnet::unescape($url);
+ $url=&unescape($url);
$alreadyseen{$url}=1;
$r->rflush();
if (($url) && ($url!~/^\/uploaded\//) && ($url!~/\*$/)) {
@@ -1771,14 +1773,14 @@
&tiehash();
foreach (keys %hash) {
if ($hash{$_}=~/\.(page|sequence)$/) {
- if (($_=~/^src_/) && ($alreadyseen{&Apache::lonnet::unescape($hash{$_})})) {
+ if (($_=~/^src_/) && ($alreadyseen{&unescape($hash{$_})})) {
$r->print('<hr /><font color="red">'.
&mt('The following sequence or page is included more than once in your course: ').
- &Apache::lonnet::unescape($hash{$_}).'</font><br />'.
+ &unescape($hash{$_}).'</font><br />'.
&mt('Note that grading records for problems included in this sequence or folder will overlap.<hr />'));
}
}
- if (($_=~/^src\_(.+)$/) && (!$alreadyseen{&Apache::lonnet::unescape($hash{$_})})) {
+ if (($_=~/^src\_(.+)$/) && (!$alreadyseen{&unescape($hash{$_})})) {
&checkonthis($r,$hash{$_},0,$hash{'title_'.$1});
}
}
@@ -2066,12 +2068,12 @@
my ($r,$postexec,$message,$url)=@_;
if (!&is_hash_old()) { return; }
my $pathvar='folderpath';
- my $path=&Apache::lonnet::escape($env{'form.folderpath'});
+ my $path=&escape($env{'form.folderpath'});
if (!defined($url)) {
if (defined($env{'form.pagepath'})) {
$pathvar='pagepath';
- $path=&Apache::lonnet::escape($env{'form.pagepath'});
- $path.='&pagesymb='.&Apache::lonnet::escape($env{'form.pagesymb'});
+ $path=&escape($env{'form.pagepath'});
+ $path.='&pagesymb='.&escape($env{'form.pagesymb'});
}
$url='/adm/coursedocs?'.$pathvar.'='.$path;
}
@@ -2147,12 +2149,12 @@
'markedcopy_title']);
if ($env{'form.folderpath'}) {
my (@folderpath)=split('&',$env{'form.folderpath'});
- $env{'form.foldername'}=&Apache::lonnet::unescape(pop(@folderpath));
+ $env{'form.foldername'}=&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.pagename'}=&unescape(pop(@pagepath));
$env{'form.folder'}=pop(@pagepath);
$containertag = '<input type="hidden" name="pagepath" value="" />'.
'<input type="hidden" name="pagesymb" value="" />';
@@ -2184,7 +2186,7 @@
# get personal data
my $uname=$env{'user.name'};
my $udom=$env{'user.domain'};
- my $plainname=&Apache::lonnet::escape(
+ my $plainname=&escape(
&Apache::loncommon::plainname($uname,$udom));
# graphics settings
@@ -2218,15 +2220,15 @@
my %attribs = ();
my $updateflag = 0;
my $residx = $env{'form.newidx'};
- my $primary_url = &Apache::lonnet::unescape($env{'form.primaryurl'});
+ my $primary_url = &unescape($env{'form.primaryurl'});
# Process file upload - phase two - gather secondary files.
for (my $i=0; $i<$env{'form.phasetwo'}; $i++) {
if ($env{'form.embedded_item_'.$i.'.filename'}) {
my $javacodebase;
$newname{$i} = &process_secondary_uploads(\$upload_output,$coursedom,$coursenum,'embedded_item_',$i,$residx);
- $origname{$i} = &Apache::lonnet::unescape($env{'form.embedded_orig_'.$i});
+ $origname{$i} = &unescape($env{'form.embedded_orig_'.$i});
if (exists($env{'form.embedded_codebase_'.$i})) {
- $javacodebase = &Apache::lonnet::unescape($env{'form.embedded_codebase_'.$i});
+ $javacodebase = &unescape($env{'form.embedded_codebase_'.$i});
$origname{$i} =~ s#^\Q$javacodebase\E/##;
}
my @attributes = ();
@@ -2236,7 +2238,7 @@
@attributes = ($env{'form.embedded_attrib_'.$i});
}
foreach (@attributes) {
- push(@{$attribs{$i}},&Apache::lonnet::unescape($_));
+ push(@{$attribs{$i}},&unescape($_));
}
if ($javacodebase) {
$codebase{$i} = $javacodebase;
@@ -2330,7 +2332,7 @@
if ($env{'form.folder'} eq '' ||
$env{'form.folder'} eq 'supplemental') {
$folderpath='default&'.
- &Apache::lonnet::escape(&mt('Main Course Documents'));
+ &escape(&mt('Main Course Documents'));
}
}
unless ($env{'form.pagepath'}) {
@@ -2374,7 +2376,7 @@
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&'.&escape(&mt('Main Course Documents'));
}
my $postexec='';
if ($folder eq 'default') {
@@ -2605,7 +2607,7 @@
if ($folder =~ /^supplemental$/ &&
$env{'form.folderpath'} =~ /^default\&/) {
$env{'form.folderpath'}='supplemental&'.
- &Apache::lonnet::escape(&mt('Supplemental Course Documents'));
+ &escape(&mt('Supplemental Course Documents'));
}
&editor($r,$coursenum,$coursedom,$folder,$allowed);
if ($allowed) {
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.203 loncom/interface/lonfeedback.pm:1.204
--- loncom/interface/lonfeedback.pm:1.203 Wed May 10 18:47:22 2006
+++ loncom/interface/lonfeedback.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.203 2006/05/10 22:47:22 albertel Exp $
+# $Id: lonfeedback.pm,v 1.204 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -43,6 +43,8 @@
use HTML::LCParser();
use Apache::lonspeller();
use Cwd;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
sub discussion_open {
my ($status,$symb)=@_;
@@ -394,7 +396,7 @@
$discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$ressymb.'" ><table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">';
$discussion .='<tr><td bgcolor="#DDDDBB" colspan="'.$colspan.'">'.
'<table border="0" width="100%" bgcolor="#DDDDBB"><tr>';
- my $escsymb=&Apache::lonnet::escape($ressymb);
+ my $escsymb=&escape($ressymb);
if ($visible>2) {
$discussion.='<td align="left">'.
'<a href="/adm/feedback?cmd=threadedon&symb='.$escsymb;
@@ -694,8 +696,8 @@
my $subject = '';
if ($env{'form.origpage'}) {
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['addnewattach','deloldattach','delnewattach','timestamp','idx','subject','comment']);
- $subject = &Apache::lonnet::unescape($env{'form.subject'});
- $comment = &Apache::lonnet::unescape($env{'form.comment'});
+ $subject = &unescape($env{'form.subject'});
+ $comment = &unescape($env{'form.comment'});
my @keepold = ();
&process_attachments(\@currnewattach,\@currdelold,\@keepold);
if (@currnewattach > 0) {
@@ -751,13 +753,13 @@
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
if ($outputtarget ne 'tex') {
$discussion.='<a href="/adm/feedback?replydisc='.
- &Apache::lonnet::escape($ressymb).':::" '.$target.'>'.
+ &escape($ressymb).':::" '.$target.'>'.
'<img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" border="0" />'.
&mt('Post Discussion').'</a><br />';
}
}
$discussion.='<a href="/adm/feedback?sendmessageonly=1&symb='.
- &Apache::lonnet::escape($ressymb).
+ &escape($ressymb).
'"><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/feedback.gif').'" border="0" />'.
&mt('Send Message').'</td></tr></table>';
}
@@ -769,7 +771,7 @@
my @original=();
my @index=();
my $symb=&Apache::lonenc::check_decrypt($ressymb);
- my $escsymb=&Apache::lonnet::escape($ressymb);
+ my $escsymb=&escape($ressymb);
my %contrib=&Apache::lonnet::restore($symb,$env{'request.course.id'},
$env{'course.'.$env{'request.course.id'}.'.domain'},
$env{'course.'.$env{'request.course.id'}.'.num'});
@@ -1443,8 +1445,8 @@
}
if ($env{'form.origpage'}) {
- $subject = &Apache::lonnet::unescape($env{'form.subject'});
- $comment = &Apache::lonnet::unescape($env{'form.comment'});
+ $subject = &unescape($env{'form.subject'});
+ $comment = &unescape($env{'form.comment'});
&process_attachments(\@currnewattach,\@currdelold,\@keepold);
}
my $latexHelp=&Apache::loncommon::helpLatexCheatsheet();
@@ -2659,7 +2661,7 @@
sub modify_attachments {
my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_;
- my $orig_subject = &Apache::lonnet::unescape($env{'form.subject'});
+ my $orig_subject = &unescape($env{'form.subject'});
my $subject=&clear_out_html($orig_subject,undef,1);
$subject=~s/\n/\<br \/\>/g;
$subject=&Apache::lontexconvert::msgtexconverted($subject);
Index: loncom/interface/longroupchat.pm
diff -u loncom/interface/longroupchat.pm:1.7 loncom/interface/longroupchat.pm:1.8
--- loncom/interface/longroupchat.pm:1.7 Thu May 18 13:58:14 2006
+++ loncom/interface/longroupchat.pm Tue May 30 08:46:09 2006
@@ -1,6 +1,8 @@
# The LearningOnline Network
# "Group Chat Frame" Personal Information
#
+# $Id: longroupchat.pm,v 1.8 2006/05/30 12:46:09 www Exp $
+#
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -31,6 +33,9 @@
use Apache::loncommon();
use Apache::lonlocal;
use Apache::longroup();
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
sub handler {
my ($r) = @_;
@@ -45,7 +50,7 @@
my %group_info =
&Apache::longroup::get_group_settings($curr_groups{$group});
$grouptitle = &mt('Group Chat:').' '.
- &Apache::lonnet::unescape($group_info{description});
+ &unescape($group_info{description});
}
}
Index: loncom/interface/lonhelp.pm
diff -u loncom/interface/lonhelp.pm:1.26 loncom/interface/lonhelp.pm:1.27
--- loncom/interface/lonhelp.pm:1.26 Tue May 23 14:13:07 2006
+++ loncom/interface/lonhelp.pm Tue May 30 08:46:09 2006
@@ -1,4 +1,7 @@
# The LearningOnline Network with CAPA
+#
+# $Id: lonhelp.pm,v 1.27 2006/05/30 12:46:09 www Exp $
+#
# .tex help system web server handler
#
# Copyright Michigan State University Board of Trustees
@@ -24,8 +27,7 @@
# http://www.lon-capa.org/
#
# .tex file help handler
-# YEAR=2002
-# 7/4 Jeremy Bowers
+
package Apache::lonhelp;
@@ -40,6 +42,9 @@
use Apache::lonnet;
use tth();
use GDBM_File();
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
# This sub takes the name of a label in, and converts it to something
# that is a valid anchor name.
@@ -199,7 +204,7 @@
$text=&listmatches($docroot,$env{'form.searchterm'});
}
} else {
- my $filenames = &Apache::lonnet::unescape(substr ($ENV{'REQUEST_URI'} ,
+ my $filenames = &unescape(substr ($ENV{'REQUEST_URI'} ,
rindex($ENV{'REQUEST_URI'}, '/') + 1, -4));
# Security check on the file; the whole filename must consist
Index: loncom/interface/lonhelper.pm
diff -u loncom/interface/lonhelper.pm:1.151 loncom/interface/lonhelper.pm:1.152
--- loncom/interface/lonhelper.pm:1.151 Wed May 17 21:08:51 2006
+++ loncom/interface/lonhelper.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# .helper XML handler to implement the LON-CAPA helper
#
-# $Id: lonhelper.pm,v 1.151 2006/05/18 01:08:51 raeburn Exp $
+# $Id: lonhelper.pm,v 1.152 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -185,6 +185,8 @@
use Apache::lonnet;
use Apache::longroup;
use Apache::lonselstudent;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
# Register all the tags with the helper, so the helper can
# push and pop them
@@ -469,8 +471,8 @@
my $self = shift;
my @vars = ();
for my $key (keys %{$self->{VARS}}) {
- push @vars, &Apache::lonnet::escape($key) . '=' .
- &Apache::lonnet::escape($self->{VARS}->{$key});
+ push @vars, &escape($key) . '=' .
+ &escape($self->{VARS}->{$key});
}
return join ('&', @vars);
}
Index: loncom/interface/lonhelpmenu.pm
diff -u loncom/interface/lonhelpmenu.pm:1.24 loncom/interface/lonhelpmenu.pm:1.25
--- loncom/interface/lonhelpmenu.pm:1.24 Mon Apr 10 17:40:08 2006
+++ loncom/interface/lonhelpmenu.pm Tue May 30 08:46:09 2006
@@ -32,6 +32,8 @@
use Apache::loncommon();
use Apache::lonlocal;
use Apache::lonnet;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
sub handler {
my ($r) = @_;
@@ -82,7 +84,7 @@
}
my $scripttag = '';
if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) {
- my $displayurl = &Apache::lonnet::escape($origurl);
+ my $displayurl = &escape($origurl);
$scripttag = (<<"SCRIPT_ONE");
<script>
function gohelpdesk() {
@@ -283,7 +285,7 @@
if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) {
$r->print("
<ul>
- <li><a href=\"/adm/support?origurl=".&Apache::lonnet::escape($origurl)."&function=$function\">$lt{'cont'}</a></li>
+ <li><a href=\"/adm/support?origurl=".&escape($origurl)."&function=$function\">$lt{'cont'}</a></li>
</ul>
<p>$lt{'suhr'}");
unless ($env{'user.adv'}) {
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.129 loncom/interface/lonhtmlcommon.pm:1.130
--- loncom/interface/lonhtmlcommon.pm:1.129 Mon May 29 12:01:22 2006
+++ loncom/interface/lonhtmlcommon.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.129 2006/05/29 16:01:22 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.130 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -60,6 +60,8 @@
use Time::HiRes;
use Apache::lonlocal;
use Apache::lonnet;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
##############################################
##############################################
@@ -93,7 +95,7 @@
sub recent_filename {
my $area=shift;
- return 'nohist_recent_'.&Apache::lonnet::escape($area);
+ return 'nohist_recent_'.&escape($area);
}
sub store_recent {
@@ -115,7 +117,7 @@
}
# store new value
&Apache::lonnet::put($file,{ $name =>
- time.'&'.&Apache::lonnet::escape($value) });
+ time.'&'.&escape($value) });
}
sub remove_recent {
@@ -134,7 +136,7 @@
unless ($_=~/^error\:/) {
my $escaped = &Apache::loncommon::escape_url($_);
$return.="\n<option value='$escaped'>".
- &Apache::lonnet::unescape((split(/\&/,$recent{$_}))[1]).
+ &unescape((split(/\&/,$recent{$_}))[1]).
'</option>';
}
}
@@ -158,7 +160,7 @@
my $idx = 1;
foreach (reverse sort keys %time_hash) {
$return_hash{$time_hash{$_}} =
- &Apache::lonnet::unescape((split(/\&/,$recent{$_}))[1]);
+ &unescape((split(/\&/,$recent{$_}))[1]);
if ($n && ($idx++ >= $n)) {last;}
}
@@ -1079,7 +1081,7 @@
if (defined($#fields)) {
unless ($#fields>=0) { return ''; }
}
- return '<a href="'.&HTML::Entities::encode('/adm/preferences?action=set_wysiwyg&wysiwyg=off&returnurl=','<>&"').&Apache::lonnet::escape($ENV{'REQUEST_URI'}).'">'.&mt('Disable WYSIWYG Editor').'</a>';
+ return '<a href="'.&HTML::Entities::encode('/adm/preferences?action=set_wysiwyg&wysiwyg=off&returnurl=','<>&"').&escape($ENV{'REQUEST_URI'}).'">'.&mt('Disable WYSIWYG Editor').'</a>';
}
sub enablelink {
@@ -1087,7 +1089,7 @@
if (defined($#fields)) {
unless ($#fields>=0) { return ''; }
}
- return '<a href="'.&HTML::Entities::encode('/adm/preferences?action=set_wysiwyg&wysiwyg=on&returnurl=','<>&"').&Apache::lonnet::escape($ENV{'REQUEST_URI'}).'">'.&mt('Enable WYSIWYG Editor').'</a>';
+ return '<a href="'.&HTML::Entities::encode('/adm/preferences?action=set_wysiwyg&wysiwyg=on&returnurl=','<>&"').&escape($ENV{'REQUEST_URI'}).'">'.&mt('Enable WYSIWYG Editor').'</a>';
}
# ----------------------------------------- Script to activate only some fields
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.182 loncom/interface/lonmenu.pm:1.183
--- loncom/interface/lonmenu.pm:1.182 Mon May 15 13:27:51 2006
+++ loncom/interface/lonmenu.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.182 2006/05/15 17:27:51 albertel Exp $
+# $Id: lonmenu.pm,v 1.183 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -44,6 +44,8 @@
use Apache::loncommon();
use Apache::lonenc();
use Apache::lonlocal;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
use vars qw(@desklines $readdesk);
@@ -83,14 +85,14 @@
my $docs='';
my $groups='';
my $showgroups=0;
- my $escurl=&Apache::lonnet::escape(&Apache::lonenc::check_encrypt($env{'request.noversionuri'}));
- my $escsymb=&Apache::lonnet::escape(&Apache::lonenc::check_encrypt($env{'request.symb'}));
+ my $escurl=&escape(&Apache::lonenc::check_encrypt($env{'request.noversionuri'}));
+ my $escsymb=&escape(&Apache::lonenc::check_encrypt($env{'request.symb'}));
if ($env{'request.state'} eq 'construct') {
if (($env{'request.noversionuri'} eq '') || (!defined($env{'request.noversionuri'}))) {
my $returnurl = $env{'request.filename'};
$returnurl =~ s:^/home/([^/]+)/public_html/(.*)$:/priv/$1/$2:;
- $escurl = &Apache::lonnet::escape($returnurl);
+ $escurl = &escape($returnurl);
}
}
if ($env{'request.course.id'}) {
@@ -114,7 +116,7 @@
if (($env{'request.noversionuri'}=~/^\/adm\//) &&
($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&
($env{'request.noversionuri'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) {
- my $escreload=&Apache::lonnet::escape('return:');
+ my $escreload=&escape('return:');
$reloadlink=(<<ENDRELOAD);
<a href="/adm/flip?postdata=$escreload" target="_top">$lt{'ret'}</a>
ENDRELOAD
@@ -209,14 +211,14 @@
m[^/adm/.*/(smppg|bulletinboard|aboutme)($|\?)])
)
) {
- my $escreload=&Apache::lonnet::escape('return:');
+ my $escreload=&escape('return:');
$reloadlink=(<<ENDRELOAD);
<td><a href="/adm/flip?postdata=$escreload" target="_top">$lt{'ret'}</a></td>
ENDRELOAD
}
}
if (($env{'request.state'} eq 'construct') && ($env{'request.course.id'})) {
- my $escreload=&Apache::lonnet::escape('return:');
+ my $escreload=&escape('return:');
$reloadlink=(<<ENDCRELOAD);
<td><a href="/adm/flip?postdata=$escreload" target="_top">$lt{'ret'}</a></td>
ENDCRELOAD
@@ -277,7 +279,7 @@
($env{'environment.remote'} eq 'off') ||
((($env{'request.publicaccess'}) ||
(!&Apache::lonnet::is_on_map(
- &Apache::lonnet::unescape($env{'request.noversionuri'})))) &&
+ &unescape($env{'request.noversionuri'})))) &&
(!$forcereg))) {
return $result.
'<script type="text/javascript">function LONCAPAreg(){;} function LONCAPAstale(){}</script>'.$force_title;
@@ -531,7 +533,7 @@
# Registered, graphical output
} else {
my $requri=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));
- $requri=&Apache::lonenc::check_encrypt(&Apache::lonnet::unescape($requri));
+ $requri=&Apache::lonenc::check_encrypt(&unescape($requri));
my $cursymb=&Apache::lonenc::check_encrypt($env{'request.symb'});
my $navstatus=&get_nav_status();
my $clearcstr;
@@ -646,7 +648,7 @@
# The Remote actually gets launched!
#
my $configmenu=&rawconfig();
- my $esclowerurl=&Apache::lonnet::escape($lowerurl);
+ my $esclowerurl=&escape($lowerurl);
my $message=&mt('"Waiting for Remote Control window to load: "+[_1]','waited');
return(<<ENDREMOTESTARTUP);
<script type="text/javascript">
@@ -729,7 +731,7 @@
if (($env{'browser.interface'} eq 'textual') ||
($env{'environment.remote'} eq 'off')) { return ''; }
- my $esclowerurl=&Apache::lonnet::escape($lowerurl);
+ my $esclowerurl=&escape($lowerurl);
my $link=&mt('<a href="[_1]">Continue</a> on in Inline Menu mode',
"/adm/remote?action=collapse&url=$esclowerurl");
return(<<ENDREMOTEFORM);
@@ -1045,7 +1047,7 @@
unless (($env{'browser.interface'} eq 'textual') ||
($env{'environment.remote'} eq 'off') || ($caller eq '/adm/menu')) { return ''; }
my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));
- $currenturl=&Apache::lonenc::check_encrypt(&Apache::lonnet::unescape($currenturl));
+ $currenturl=&Apache::lonenc::check_encrypt(&unescape($currenturl));
my $currentsymb=&Apache::lonenc::check_encrypt($env{'request.symb'});
my $nav_control=&nav_control_js();
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.156 loncom/interface/lonmeta.pm:1.157
--- loncom/interface/lonmeta.pm:1.156 Sat May 20 02:40:53 2006
+++ loncom/interface/lonmeta.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.156 2006/05/20 06:40:53 albertel Exp $
+# $Id: lonmeta.pm,v 1.157 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -39,6 +39,8 @@
use Apache::lonlocal;
use Apache::lonmysql;
use Apache::lonmsg;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
############################################################
@@ -108,7 +110,7 @@
next if (! $result);
my @Data =
map {
- &Apache::lonnet::unescape($_);
+ &unescape($_);
} split(',',$result);
my $url = $Data[0];
for (my $i=0;$i<=$#Fields;$i++) {
Index: loncom/interface/lonmodifycourse.pm
diff -u loncom/interface/lonmodifycourse.pm:1.24 loncom/interface/lonmodifycourse.pm:1.25
--- loncom/interface/lonmodifycourse.pm:1.24 Thu Mar 23 17:32:10 2006
+++ loncom/interface/lonmodifycourse.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# automated enrollment course setup handler
#
-# $Id: lonmodifycourse.pm,v 1.24 2006/03/23 22:32:10 albertel Exp $
+# $Id: lonmodifycourse.pm,v 1.25 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -35,6 +35,7 @@
use Apache::londropadd;
use LONCAPA::Enrollment;
use lib '/home/httpd/lib/perl';
+use LONCAPA;
sub print_course_selection_page {
my ($r,$tasklongref) = @_;
@@ -101,12 +102,12 @@
if ($item =~ m/^($dom)_(\w+)$/) {
$crs = $2;
if ($courseIDs{$item} =~ /^([^:]*):([^:]*):([^:]*)/) {
- $description = &Apache::lonnet::unescape($1);
- $owner = &Apache::lonnet::unescape($3);
+ $description = &unescape($1);
+ $owner = &unescape($3);
} elsif ($courseIDs{$item} =~ /^([^:]*):([^:]*)$/) {
- $description = &Apache::lonnet::unescape($1);
+ $description = &unescape($1);
} else {
- $description = &Apache::lonnet::unescape($courseIDs{$item});
+ $description = &unescape($courseIDs{$item});
}
# Get course owner
if ($owner eq '') {
@@ -534,7 +535,7 @@
}
}
if ($changeowner == 1 || $changecode == 1) {
- my $courseid_entry = &Apache::lonnet::escape($dom.'_'.$crs).'='.&Apache::lonnet::escape($description).':'.&Apache::lonnet::escape($env{'form.coursecode'}).':'.&Apache::lonnet::escape($env{'form.courseowner'});
+ my $courseid_entry = &escape($dom.'_'.$crs).'='.&escape($description).':'.&escape($env{'form.coursecode'}).':'.&escape($env{'form.courseowner'});
&Apache::lonnet::courseidput($dom,$courseid_entry,&Apache::lonnet::homeserver($crs,$dom));
}
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.183 loncom/interface/lonmsg.pm:1.184
--- loncom/interface/lonmsg.pm:1.183 Tue Apr 25 15:45:50 2006
+++ loncom/interface/lonmsg.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging
#
-# $Id: lonmsg.pm,v 1.183 2006/04/25 19:45:50 albertel Exp $
+# $Id: lonmsg.pm,v 1.184 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -33,6 +33,8 @@
use HTML::TokeParser();
use Apache::lonlocal;
use Mail::Send;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
{
my $uniq;
@@ -59,13 +61,13 @@
my $course_context;
if (defined($env{'form.replyid'})) {
my ($sendtime,$shortsubj,$fromname,$fromdomain,$count,$origcid)=
- split(/\:/,&Apache::lonnet::unescape($env{'form.replyid'}));
+ split(/\:/,&unescape($env{'form.replyid'}));
$course_context = $origcid;
}
foreach my $key (keys(%env)) {
if ($key=~/^form\.(rep)?rec\_(.*)$/) {
my ($sendtime,$shortsubj,$fromname,$fromdomain,$count,$origcid) =
- split(/\:/,&Apache::lonnet::unescape($2));
+ split(/\:/,&unescape($2));
$course_context = $origcid;
last;
}
@@ -108,8 +110,8 @@
for (my $i=0; $i<@{$recuser}; $i++) {
if ($type eq 'dcmail') {
my ($username,$email) = split(/:/,$$recuser[$i]);
- $username = &Apache::lonnet::unescape($username);
- $email = &Apache::lonnet::unescape($email);
+ $username = &unescape($username);
+ $email = &unescape($email);
$username = &HTML::Entities::encode($username,'<>&"');
$email = &HTML::Entities::encode($email,'<>&"');
$result .= '<recipient username="'.$username.'">'.
@@ -178,17 +180,17 @@
sub buildmsgid {
my ($now,$subject,$uname,$udom,$msgcount,$course_context,$pid) = @_;
- $subject=&Apache::lonnet::escape($subject);
- return(&Apache::lonnet::escape($now.':'.$subject.':'.$uname.':'.
+ $subject=&escape($subject);
+ return(&escape($now.':'.$subject.':'.$uname.':'.
$udom.':'.$msgcount.':'.$course_context.':'.$pid));
}
sub unpackmsgid {
my ($msgid,$folder,$skipstatus,$status_cache)=@_;
- $msgid=&Apache::lonnet::unescape($msgid);
+ $msgid=&unescape($msgid);
my ($sendtime,$shortsubj,$fromname,$fromdomain,$count,$fromcid,
- $processid)=split(/\:/,&Apache::lonnet::unescape($msgid));
- $shortsubj = &Apache::lonnet::unescape($shortsubj);
+ $processid)=split(/\:/,&unescape($msgid));
+ $shortsubj = &unescape($shortsubj);
$shortsubj = &HTML::Entities::decode($shortsubj);
if (!defined($processid)) { $fromcid = ''; }
my %status=();
@@ -286,8 +288,8 @@
($msgid,$message)=&packagemsg($filename,$message);
return &Apache::lonnet::reply('put:'.$domain.':'.$author.
':nohist_res_msgs:'.
- &Apache::lonnet::escape($filename.'_'.$id).'='.
- &Apache::lonnet::escape($message),$homeserver);
+ &escape($filename.'_'.$id).'='.
+ &escape($message),$homeserver);
}
return 'no_host';
}
@@ -367,8 +369,8 @@
if ($sendback) { $message.='<sendback>true</sendback>'; }
$status=&Apache::lonnet::critical(
'put:'.$domain.':'.$user.':critical:'.
- &Apache::lonnet::escape($msgid).'='.
- &Apache::lonnet::escape($message),$homeserver);
+ &escape($msgid).'='.
+ &escape($message),$homeserver);
if (defined($sentmessage)) {
$$sentmessage = $message;
}
@@ -486,8 +488,8 @@
# Store in user folder
$status=&Apache::lonnet::critical(
'put:'.$domain.':'.$user.':nohist_email:'.
- &Apache::lonnet::escape($msgid).'='.
- &Apache::lonnet::escape($packed_message),$homeserver);
+ &escape($msgid).'='.
+ &escape($packed_message),$homeserver);
# Save new message received time
&Apache::lonnet::put
('email_status',{'recnewemail'=>time},$domain,$user);
@@ -571,8 +573,8 @@
my $status =' '.&Apache::lonnet::critical(
'put:'.$env{'user.domain'}.':'.$env{'user.name'}.
':nohist_email_sent:'.
- &Apache::lonnet::escape($msgid).'='.
- &Apache::lonnet::escape($message),$env{'user.home'});
+ &escape($msgid).'='.
+ &escape($message),$env{'user.home'});
return $status;
}
@@ -581,7 +583,7 @@
sub foldersuffix {
my $folder=shift;
unless ($folder) { return ''; }
- return '_'.&Apache::lonnet::escape($folder);
+ return '_'.&escape($folder);
}
1;
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.28 loncom/interface/lonmsgdisplay.pm:1.29
--- loncom/interface/lonmsgdisplay.pm:1.28 Tue May 23 17:42:09 2006
+++ loncom/interface/lonmsgdisplay.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging display
#
-# $Id: lonmsgdisplay.pm,v 1.28 2006/05/23 21:42:09 foxr Exp $
+# $Id: lonmsgdisplay.pm,v 1.29 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -126,6 +126,8 @@
use Apache::lonfeedback;
use Apache::lonrss();
use Apache::lonselstudent();
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
# Querystring component with sorting type
my $sqs;
@@ -344,7 +346,7 @@
}
foreach my $msgid (@messages) {
- my $esc_msgid=&Apache::lonnet::escape($msgid);
+ my $esc_msgid=&escape($msgid);
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid)=
&Apache::lonmsg::unpackmsgid($esc_msgid,$folder,undef,
\%status_cache);
@@ -470,7 +472,7 @@
&Apache::lonnet::get('email_status',\@msgids);
my %descriptions;
foreach (@msgids) {
- my $msgid=&Apache::lonnet::escape($_);
+ my $msgid=&escape($_);
my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)=
&Apache::lonmsg::unpackmsgid($msgid,undef,undef,\%status_cache);
if (defined($sendtime) && $sendtime!~/error/) {
@@ -653,7 +655,7 @@
$dis_name = join('<br />',@{$recv_name});
$dis_domain = join('<br />',@{$recv_domain});
} else {
- my $msg_id = &Apache::lonnet::unescape($origID);
+ my $msg_id = &unescape($origID);
my %message = &Apache::lonnet::get('nohist_email'.$suffix,
[$msg_id]);
my %content = &Apache::lonmsg::unpackagemsg($message{$msg_id});
@@ -672,7 +674,7 @@
} elsif ($status eq 'deleted') {
# purge
my ($result,$msg) =
- &movemsg(&Apache::lonnet::unescape($origID),$folder,'trash');
+ &movemsg(&unescape($origID),$folder,'trash');
}
}
@@ -716,15 +718,15 @@
'Broadcast Message');
} elsif ($forwarding) {
&Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"/adm/email?display=".&Apache::lonnet::escape($forwarding),
+ ({href=>"/adm/email?display=".&escape($forwarding),
text=>"Display Message"});
- &printheader($r,'/adm/email?forward='.&Apache::lonnet::escape($forwarding),
+ &printheader($r,'/adm/email?forward='.&escape($forwarding),
'Forwarding a Message');
} elsif ($replying) {
&Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"/adm/email?display=".&Apache::lonnet::escape($replying),
+ ({href=>"/adm/email?display=".&escape($replying),
text=>"Display Message"});
- &printheader($r,'/adm/email?replyto='.&Apache::lonnet::escape($replying),
+ &printheader($r,'/adm/email?replyto='.&escape($replying),
'Replying to a Message');
} elsif ($replycrit) {
$r->print('<h3>'.&mt('Replying to a Critical Message').'</h3>');
@@ -774,7 +776,7 @@
$dismsg=&mt('Forwarded message from').' '.
$content{'sendername'}.' '.&mt('at').' '.$content{'senderdomain'};
if ($content{'baseurl'}) {
- $disbase='<input type="hidden" name="baseurl" value="'.&Apache::lonnet::escape($content{'baseurl'}).'" />';
+ $disbase='<input type="hidden" name="baseurl" value="'.&escape($content{'baseurl'}).'" />';
}
}
if ($replying) {
@@ -790,11 +792,11 @@
$dismsg=~s/\f/\n/g;
$dismsg=~s/\n+/\n\> /g;
if ($content{'baseurl'}) {
- $disbase='<input type="hidden" name="baseurl" value="'.&Apache::lonnet::escape($content{'baseurl'}).'" />';
+ $disbase='<input type="hidden" name="baseurl" value="'.&escape($content{'baseurl'}).'" />';
if ($env{'user.adv'}) {
$disbase.='<label><input type="checkbox" name="storebasecomment" />'.&mt('Store message for re-use').
'</label> <a href="/adm/email?showcommentbaseurl='.
- &Apache::lonnet::escape($content{'baseurl'}).'" target="comments">'.
+ &escape($content{'baseurl'}).'" target="comments">'.
&mt('Show re-usable messages').'</a><br />';
}
}
@@ -940,7 +942,7 @@
$result .='<h3>'.&mt('Broadcast Message').'</h3>';
if ($content{'subject'}=~/^Broadcast\./) {
if (defined($content{'coursemsgid'})) {
- my $crsmsgid = &Apache::lonnet::escape($content{'coursemsgid'});
+ my $crsmsgid = &escape($content{'coursemsgid'});
my $broadcast_message = &general_message($crsmsgid);
$content{'message'} = '<b>'.&mt('Subject').': '.$content{'message'}.'</b><br />'.$broadcast_message;
} else {
@@ -953,7 +955,7 @@
} else {
$result.='<h3>'.&mt('Critical Message').'</h3>';
if (defined($content{'coursemsgid'})) {
- my $crsmsgid=&Apache::lonnet::escape($content{'coursemsgid'});
+ my $crsmsgid=&escape($content{'coursemsgid'});
my $critical_message = &general_message($crsmsgid);
$content{'message'} = '<b>'.&mt('Subject').': '.$content{'message'}.'</b><br />'.$critical_message;
} else {
@@ -1434,7 +1436,7 @@
my $counter=0;
$r->print('<pre>');
- my $escmsgid=&Apache::lonnet::escape($msgid);
+ my $escmsgid=&escape($msgid);
foreach (@messages) {
if ($_->[5] eq $escmsgid){
last;
@@ -1444,17 +1446,17 @@
$r->print('</pre>');
my $number_of_messages = scalar(@messages); #subtract 1 for last index
# start output
- &printheader($r,'/adm/email?display='.&Apache::lonnet::escape($msgid),'Display a Message','',$content{'baseurl'});
+ &printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','',$content{'baseurl'});
my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'});
# Functions
$r->print('<table border="2" width="100%"><tr bgcolor="#FFFFAA"><td>'.&mt('Functions').':</td>'.
- '<td><a href="/adm/email?replyto='.&Apache::lonnet::escape($msgid).$sqs.
+ '<td><a href="/adm/email?replyto='.&escape($msgid).$sqs.
'"><b>'.&mt('Reply').'</b></a></td>'.
- '<td><a href="/adm/email?forward='.&Apache::lonnet::escape($msgid).$sqs.
+ '<td><a href="/adm/email?forward='.&escape($msgid).$sqs.
'"><b>'.&mt('Forward').'</b></a></td>'.
- '<td><a href="/adm/email?markunread='.&Apache::lonnet::escape($msgid).$sqs.
+ '<td><a href="/adm/email?markunread='.&escape($msgid).$sqs.
'"><b>'.&mt('Mark Unread').'</b></a></td>'.
- '<td><a href="/adm/email?markdel='.&Apache::lonnet::escape($msgid).$sqs.
+ '<td><a href="/adm/email?markdel='.&escape($msgid).$sqs.
'"><b>'.&mt('Delete').'</b></a></td>'.
'<td><a href="/adm/email?'.$sqs.
($env{'form.dismode'} eq 'new'?'&folder=new':'').
@@ -1583,14 +1585,14 @@
$cleanmsgtxt.=$_."\n";
}
}
- my $key=&Apache::lonnet::escape($env{'form.baseurl'}).'___'.time;
+ my $key=&escape($env{'form.baseurl'}).'___'.time;
&Apache::lonnet::put('nohist_stored_comments',{ $key => $cleanmsgtxt });
}
sub storedcommentlisting {
my ($r)=@_;
my %msgs=&Apache::lonnet::dump('nohist_stored_comments',undef,undef,
- '^'.&Apache::lonnet::escape(&Apache::lonnet::escape($env{'form.showcommentbaseurl'})));
+ '^'.&escape(&escape($env{'form.showcommentbaseurl'})));
$r->print(&Apache::loncommon::start_page('Stored Comment Listing',undef,
{'onlybody' => 1}));
if ((keys %msgs)[0]=~/^error\:/) {
@@ -1742,20 +1744,20 @@
my ($specialmsgid,$specialresult);
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
- my $course_str = &Apache::lonnet::escape('['.$cnum.':'.$cdom.']');
+ my $course_str = &escape('['.$cnum.':'.$cdom.']');
if ($numspecial) {
$specialresult = &Apache::lonmsg::user_normal_msg_raw($cnum,$cdom,$subj_prefix.
' '.$course_str,$savemsg,undef,undef,undef,
undef,undef,\$specialmsgid);
- $specialmsgid = &Apache::lonnet::unescape($specialmsgid);
+ $specialmsgid = &unescape($specialmsgid);
}
if ($specialresult eq 'ok') {
my $record_sent;
my @recusers;
my @recudoms;
my ($stamp,$crssubj,$msgname,$msgdom,$msgcount,$context,$pid) =
- split(/\:/,&Apache::lonnet::unescape($specialmsgid));
+ split(/\:/,&unescape($specialmsgid));
foreach my $recipient (sort(keys(%toaddr))) {
if ($specialmsg_status{$recipient} eq 'ok') {
@@ -1845,7 +1847,7 @@
unless ($folder) {
$folder='';
} else {
- $sqs.='&folder='.&Apache::lonnet::escape($folder);
+ $sqs.='&folder='.&escape($folder);
}
# ------------------------------------------------------------ Get Display Mode
@@ -1853,7 +1855,7 @@
unless ($dismode) {
$dismode='';
} else {
- $sqs.='&dismode='.&Apache::lonnet::escape($dismode);
+ $sqs.='&dismode='.&escape($dismode);
}
# --------------------------------------------------------------------- Display
@@ -1923,7 +1925,7 @@
foreach my $key (keys(%env)) {
if ($key=~/^form\.delmark_(.*)$/) {
my ($result,$msg) =
- &movemsg(&Apache::lonnet::unescape($1),$folder,
+ &movemsg(&unescape($1),$folder,
$env{'form.movetofolder'});
if ($result) {
$total++;
@@ -1950,7 +1952,7 @@
foreach my $key (keys(%env)) {
if ($key=~/^form\.delmark_(.*)$/) {
my ($result,$msg) =
- &statuschange(&Apache::lonnet::unescape($1),'deleted',
+ &statuschange(&unescape($1),'deleted',
$folder);
if ($result) {
$total++;
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.383 loncom/interface/lonnavmaps.pm:1.384
--- loncom/interface/lonnavmaps.pm:1.383 Mon May 15 19:40:54 2006
+++ loncom/interface/lonnavmaps.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.383 2006/05/15 23:40:54 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.384 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -40,6 +40,8 @@
use POSIX qw (floor strftime);
use Data::Dumper; # for debugging, not always
use Time::HiRes qw( gettimeofday tv_interval );
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
# symbolic constants
sub SYMB { return 1; }
@@ -469,14 +471,14 @@
my $anchor;
if ($res->is_page()) {
foreach (@$stack) { if (defined($_)) { $anchor = $_; } }
- $anchor=&Apache::lonnet::escape($anchor->shown_symb());
+ $anchor=&escape($anchor->shown_symb());
return ($res->link(),$res->shown_symb(),$anchor);
}
# in case folder was skipped over as "only sequence"
my ($map,$id,$src)=&Apache::lonnet::decode_symb($res->symb());
if ($map=~/\.page$/) {
my $url=&Apache::lonnet::clutter($map);
- $anchor=&Apache::lonnet::escape($src->shown_symb());
+ $anchor=&escape($src->shown_symb());
return ($url,$res->shown_symb(),$anchor);
}
}
@@ -1122,9 +1124,9 @@
removeFromFilter($filter, $mapId);
$linkopen .= "&condition=" . $it->{CONDITION} . '&hereType='
. $params->{'hereType'} . '&here=' .
- &Apache::lonnet::escape($params->{'here'}) .
+ &escape($params->{'here'}) .
'&jump=' .
- &Apache::lonnet::escape($resource->symb()) .
+ &escape($resource->symb()) .
"&folderManip=1\">";
} else {
@@ -1176,7 +1178,7 @@
!$params->{'condensed'}) {
my $displaypart=$resource->part_display($part);
$partLabel = " (".&mt('Part: [_1]', $displaypart).")";
- if ($link!~/\#/) { $link.='#'.&Apache::lonnet::escape($part); }
+ if ($link!~/\#/) { $link.='#'.&escape($part); }
$title = "";
}
@@ -1220,7 +1222,7 @@
foreach (split(/\,/, $feedback)) {
if ($_) {
$feedbackHTML .= ' <a '.$target.' href="/adm/email?display='
- . &Apache::lonnet::escape($_) . '">'
+ . &escape($_) . '">'
. '<img src="'.$location.'/feedback.gif" '
. 'border="0" /></a>';
}
@@ -1235,7 +1237,7 @@
if ($_) {
$errorcount++;
$errorHTML .= ' <a '.$target.' href="/adm/email?display='
- . &Apache::lonnet::escape($_) . '">'
+ . &escape($_) . '">'
. '<img src="'.$location.'/bomb.gif" '
. 'border="0" /></a>';
}
@@ -1608,11 +1610,11 @@
my ($link,$text);
if ($condition) {
$link='"navmaps?condition=0&filter=&'.$queryString.
- '&here='.&Apache::lonnet::escape($here).'"';
+ '&here='.&escape($here).'"';
$text='Close all folders';
} else {
$link='"navmaps?condition=1&filter=&'.$queryString.
- '&here='.&Apache::lonnet::escape($here).'"';
+ '&here='.&escape($here).'"';
$text='Open all folders';
}
if ($args->{'caller'} eq 'navmapsdisplay') {
@@ -1923,7 +1925,7 @@
my $srcHasQuestion = $src =~ /\?/;
$args->{"resourceLink"} = $src.
($srcHasQuestion?'&':'?') .
- 'symb=' . &Apache::lonnet::escape($symb).$anchor;
+ 'symb=' . &escape($symb).$anchor;
}
# Now, we've decided what parts to show. Loop through them and
# show them.
@@ -2228,7 +2230,7 @@
foreach my $msgid (@keys) {
if ((!$emailstatus{$msgid}) || ($emailstatus{$msgid} eq 'new')) {
my $plain=
- &Apache::lonnet::unescape(&Apache::lonnet::unescape($msgid));
+ &LONCAPA::unescape(&LONCAPA::unescape($msgid));
if ($plain=~/ \[([^\]]+)\]\:/) {
my $url=$1;
if ($plain=~/\:Error \[/) {
@@ -4164,7 +4166,7 @@
used like this:
for (split(/\,/, $res->getFeedback())) {
- my $link = &Apache::lonnet::escape($_);
+ my $link = &escape($_);
...
and use the link as appropriate.
Index: loncom/interface/lonnotify.pm
diff -u loncom/interface/lonnotify.pm:1.18 loncom/interface/lonnotify.pm:1.19
--- loncom/interface/lonnotify.pm:1.18 Mon May 1 15:37:33 2006
+++ loncom/interface/lonnotify.pm Tue May 30 08:46:09 2006
@@ -34,6 +34,8 @@
use Mail::Send;
use HTML::TokeParser;
use HTML::Entities;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
sub handler {
my ($r) = @_;
@@ -624,7 +626,7 @@
}
foreach my $username (sort(keys(%recipients))) {
if ($recipients{$username} =~ /\@/) {
- my $value=&Apache::lonnet::escape($username).':'.&Apache::lonnet::escape($recipients{$username});
+ my $value=&escape($username).':'.&escape($recipients{$username});
$output .= '<tr><td><input type="checkbox" name="recipient" value="'.$value.'" /></td><td>'.$username.'</td><td> </td><td>'.$recipients{$username}.'</td></tr>';
}
}
@@ -703,7 +705,7 @@
<td>';
foreach my $person (@deliveries) {
my ($username,$email) = split(/:/,$person);
- $output .= &Apache::lonnet::unescape($email).' ('.&Apache::lonnet::unescape($username).')<br />'."\n";
+ $output .= &unescape($email).' ('.&unescape($username).')<br />'."\n";
}
$output .= '</td>
</tr>
@@ -729,8 +731,8 @@
foreach my $user (@{$recipients}) {
my $msg = new Mail::Send;
my ($username,$to) = split(/:/,$user);
- $username = &Apache::lonnet::unescape($username);
- $to = &Apache::lonnet::unescape($to);
+ $username = &unescape($username);
+ $to = &unescape($to);
$msg->to($to);
$msg->subject($subject);
$msg->add('From',"$from");
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.307 loncom/interface/lonparmset.pm:1.308
--- loncom/interface/lonparmset.pm:1.307 Wed May 17 21:08:51 2006
+++ loncom/interface/lonparmset.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.307 2006/05/18 01:08:51 raeburn Exp $
+# $Id: lonparmset.pm,v 1.308 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -65,6 +65,8 @@
use Apache::lonnavmaps;
use Apache::longroup;
use Apache::lonrss;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
# --- Caches local to lonparmset
@@ -1732,7 +1734,7 @@
'</font></tt><p><b>'.
"<a href=\"javascript:openWindow('".
&Apache::lonnet::clutter($uri).'?symb='.
- &Apache::lonnet::escape($symbp{$rid}).
+ &escape($symbp{$rid}).
"', 'metadatafile', '450', '500', 'no', 'yes')\";".
" TARGET=_self>$title");
Index: loncom/interface/lonpickcourse.pm
diff -u loncom/interface/lonpickcourse.pm:1.46 loncom/interface/lonpickcourse.pm:1.47
--- loncom/interface/lonpickcourse.pm:1.46 Wed May 17 21:08:50 2006
+++ loncom/interface/lonpickcourse.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Pick a course
#
-# $Id: lonpickcourse.pm,v 1.46 2006/05/18 01:08:50 raeburn Exp $
+# $Id: lonpickcourse.pm,v 1.47 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -35,6 +35,8 @@
use Apache::lonnet;
use Apache::lonlocal;
use Apache::longroup;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
sub handler {
my $r = shift;
@@ -286,9 +288,9 @@
foreach my $course (keys(%courses)) {
my $descr;
if ($courses{$course} =~ m/^([^:]*):/i) {
- $descr = &Apache::lonnet::unescape($1);
+ $descr = &unescape($1);
} else {
- $descr = &Apache::lonnet::unescape($courses{$course});
+ $descr = &unescape($courses{$course});
}
my $description = $descr;
push (@{$by_descrip{$description}}, $course);
@@ -311,10 +313,10 @@
($Apache::lonnet::domaindescription{$cdom}?
$Apache::lonnet::domaindescription{$cdom}:$cdom).")");
unless ($instcode eq '') {
- $r->print(" - ".&Apache::lonnet::unescape($instcode));
+ $r->print(" - ".&unescape($instcode));
}
unless ($owner eq '') {
- $r->print(", owner - ".&Apache::lonnet::unescape($owner));
+ $r->print(", owner - ".&unescape($owner));
}
if ($multiple) { $r->print("</label>\n"); }
$r->print("<br />\n");
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.438 loncom/interface/lonprintout.pm:1.439
--- loncom/interface/lonprintout.pm:1.438 Wed May 24 06:49:04 2006
+++ loncom/interface/lonprintout.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.438 2006/05/24 10:49:04 foxr Exp $
+# $Id: lonprintout.pm,v 1.439 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,6 +42,8 @@
use POSIX qw(strftime);
use Apache::lonlocal;
use Carp;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
my %perm;
@@ -707,7 +709,7 @@
sub get_course {
my $courseidinfo;
if (defined($env{'request.course.id'})) {
- $courseidinfo = &Apache::lonxml::latex_special_symbols(&Apache::lonnet::unescape($env{'course.'.$env{'request.course.id'}.'.description'}),'header');
+ $courseidinfo = &Apache::lonxml::latex_special_symbols(&unescape($env{'course.'.$env{'request.course.id'}.'.description'}),'header');
}
return $courseidinfo;
}
@@ -1733,7 +1735,7 @@
my $URLback=''; #link to original document
if ($helper->{'VARS'}->{'construction'} ne '1') {
#prints published resource
- $URLback=&Apache::lonnet::escape('/adm/flip?postdata=return:');
+ $URLback=&escape('/adm/flip?postdata=return:');
} else {
#prints resource from the construction space
$URLback='/'.$helper->{'VARS'}->{'filename'};
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.264 loncom/interface/lonsearchcat.pm:1.265
--- loncom/interface/lonsearchcat.pm:1.264 Fri May 12 12:45:41 2006
+++ loncom/interface/lonsearchcat.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Search Catalog
#
-# $Id: lonsearchcat.pm,v 1.264 2006/05/12 16:45:41 albertel Exp $
+# $Id: lonsearchcat.pm,v 1.265 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -78,6 +78,8 @@
use Parse::RecDescent;
use Apache::lonnavmaps;
use Apache::lonindexer();
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
######################################################################
######################################################################
@@ -164,8 +166,8 @@
}
my $persistent_db_file = "/home/httpd/perl/tmp/".
- &Apache::lonnet::escape($domain).
- '_'.&Apache::lonnet::escape($env{'user.name'}).
+ &escape($domain).
+ '_'.&escape($env{'user.name'}).
'_'.$env{'form.persistent_db_id'}.'_persistent_search.db';
##
&Apache::lonhtmlcommon::clear_breadcrumbs();
@@ -551,7 +553,7 @@
} else {
$url .= '?symb=';
}
- $url .= &Apache::lonnet::escape($resource->symb());
+ $url .= &escape($resource->symb());
my $title = $resource->compTitle();
$r->print('<br /><a href="'.$url.'" target="cat">'.
($title?$title:$url).'</a> - '.$disctype.'<br />');
@@ -587,7 +589,7 @@
my ($extension)=($url=~/\.(\w+)$/);
if (&Apache::loncommon::fileembstyle($extension) eq 'ssi' &&
($url) && ($fulltext)) {
- $result.=&Apache::lonnet::ssi_body($url.'?symb='.&Apache::lonnet::escape($symb));
+ $result.=&Apache::lonnet::ssi_body($url.'?symb='.&escape($symb));
}
$result=~s/\s+/ /gs;
my $applies = 0;
@@ -603,7 +605,7 @@
$href=&Apache::lonenc::encrypted($href)
.'?symb='.&Apache::lonenc::encrypted($symb);
} else {
- $href.='?symb='.&Apache::lonnet::escape($symb);
+ $href.='?symb='.&escape($symb);
}
$r->print('<a href="'.$href.'" target="cat">'.($title?$title:$url).
'</a><br />');
@@ -1147,7 +1149,7 @@
# End kludge (hopefully)
next if (exists($env{$name}));
my @values = map {
- &Apache::lonnet::unescape($_);
+ &unescape($_);
} split(',',$persistent_db{$name});
next if (@values <1);
if ($arrays_allowed{$name}) {
@@ -1193,7 +1195,7 @@
next;
}
my @values = map {
- &Apache::lonnet::unescape($_);
+ &unescape($_);
} split(',',$persistent_db{$name});
if (@values <= 1) {
push @Values,$values[0];
@@ -1230,7 +1232,7 @@
foreach my $name (keys(%save)) {
my @values = (ref($save{$name}) ? @{$save{$name}} : ($save{$name}));
# We handle array references, but not recursively.
- my $store = join(',', map { &Apache::lonnet::escape($_); } @values );
+ my $store = join(',', map { &escape($_); } @values );
$persistent_db{$name} = $store;
}
untie(%persistent_db);
@@ -1313,7 +1315,7 @@
foreach ('mode','form','element') {
# is this required? Hmmm.
next if (! exists($env{'form.'.$_}));
- $env{'form.'.$_}=&Apache::lonnet::unescape($env{'form.'.$_});
+ $env{'form.'.$_}=&unescape($env{'form.'.$_});
$env{'form.'.$_}=~s/[^\w\/\s\(\)\=\-\"\']//g;
}
# Preprocess the category form element.
@@ -1581,7 +1583,7 @@
foreach ('mode','form','element') {
# is this required? Hmmm.
next unless (exists($env{"form.$_"}));
- $env{"form.$_"}=&Apache::lonnet::unescape($env{"form.$_"});
+ $env{"form.$_"}=&unescape($env{"form.$_"});
$env{"form.$_"}=~s/[^\w\/\s\(\)\=\-\"\']//g;
}
my ($libraries_to_query,$pretty_domains_string) = &parse_domain_restrictions();
@@ -2855,7 +2857,7 @@
&set_up_table_structure();
}
for (my $i=0;$i<=$#Row;$i++) {
- $Fields{$Datatypes[$i]->{'name'}}=&Apache::lonnet::unescape($Row[$i]);
+ $Fields{$Datatypes[$i]->{'name'}}=&unescape($Row[$i]);
}
$Fields{'language'} =
&Apache::loncommon::languagedescription($Fields{'language'});
@@ -2892,7 +2894,7 @@
# conclude from self to others regarding fields
my %Fields=&LONCAPA::lonmetadata::metadata_col_to_hash
(map {
- &Apache::lonnet::unescape($_);
+ &unescape($_);
} (split(/\,/,$result)) );
return %Fields;
}
@@ -2930,7 +2932,7 @@
if ($result=~/^(custom\=.*)$/) { # grab all custom metadata
my $tmp=$result;
$tmp=~s/^custom\=//;
- my ($k,$v)=map {&Apache::lonnet::unescape($_);
+ my ($k,$v)=map {&unescape($_);
} split(/\,/,$tmp);
$customhash{$k}=$v;
}
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.135 loncom/interface/lonstatistics.pm:1.136
--- loncom/interface/lonstatistics.pm:1.135 Wed May 17 21:08:50 2006
+++ loncom/interface/lonstatistics.pm Tue May 30 08:46:09 2006
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstatistics.pm,v 1.135 2006/05/18 01:08:50 raeburn Exp $
+# $Id: lonstatistics.pm,v 1.136 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -76,6 +76,8 @@
use Apache::lonstudentsubmissions();
use Apache::lonsurveyreports();
use Apache::longradinganalysis();
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
#######################################################
#######################################################
@@ -1018,10 +1020,10 @@
$Str .= '<td>';
if ($field eq 'fullname' || $field eq 'username') {
$Str .= '<a href="/adm/statistics?reportSelected=';
- $Str .= &Apache::lonnet::escape('student_assessment');
- $Str .= '&sort='.&Apache::lonnet::escape($env{'form.sort'});
+ $Str .= &escape('student_assessment');
+ $Str .= '&sort='.&escape($env{'form.sort'});
$Str .= '&SelectedStudent=';
- $Str .= &Apache::lonnet::escape($sname).'">';
+ $Str .= &escape($sname).'">';
$Str .= $student->{$field}.' ';
$Str .= '</a>';
} elsif ($field eq 'status') {
Index: loncom/interface/lonsupportreq.pm
diff -u loncom/interface/lonsupportreq.pm:1.34 loncom/interface/lonsupportreq.pm:1.35
--- loncom/interface/lonsupportreq.pm:1.34 Thu Apr 13 15:07:11 2006
+++ loncom/interface/lonsupportreq.pm Tue May 30 08:46:09 2006
@@ -1,5 +1,5 @@
#
-# $Id: lonsupportreq.pm,v 1.34 2006/04/13 19:07:11 albertel Exp $
+# $Id: lonsupportreq.pm,v 1.35 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -36,6 +36,9 @@
use Apache::lonnet;
use Apache::lonlocal;
use Apache::lonacc();
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
sub handler {
my ($r) = @_;
@@ -50,7 +53,7 @@
&Apache::lonacc::get_posted_cgi($r);
}
my $function = $env{'form.function'};
- my $origurl = &Apache::lonnet::unescape($env{'form.origurl'});
+ my $origurl = &unescape($env{'form.origurl'});
my $action = $env{'form.action'};
if ($action eq 'process') {
@@ -976,7 +979,7 @@
my %courses = &Apache::lonnet::courseiddump($codedom,'.',1,'.','.','.');
foreach my $course (keys %courses) {
if ($courses{$course} =~ m/^[^:]*:([^:]+)/) {
- $$coursecodes{$course} = &Apache::lonnet::unescape($1);
+ $$coursecodes{$course} = &unescape($1);
$totcodes ++;
}
}
Index: loncom/interface/lontrackstudent.pm
diff -u loncom/interface/lontrackstudent.pm:1.19 loncom/interface/lontrackstudent.pm:1.20
--- loncom/interface/lontrackstudent.pm:1.19 Mon May 1 15:37:34 2006
+++ loncom/interface/lontrackstudent.pm Tue May 30 08:46:09 2006
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lontrackstudent.pm,v 1.19 2006/05/01 19:37:34 albertel Exp $
+# $Id: lontrackstudent.pm,v 1.20 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -48,6 +48,8 @@
use Apache::lonnet;
use Apache::lonlocal;
use Time::HiRes;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
my $num_records=500;
@@ -183,7 +185,7 @@
my $timestr = '';
while (my $line = <TIMEDATA>) {
chomp($line);
- $timestr = &Apache::lonnet::unescape($line);
+ $timestr = &unescape($line);
}
close(TIMEDATA);
return &Apache::lonmysql::unsqltime($timestr);
@@ -278,7 +280,7 @@
while (my $line = <ACTIVITYDATA>) {
# FIXME: does not pass symbs along :(
chomp($line);
- $line = &Apache::lonnet::unescape($line);
+ $line = &unescape($line);
if (++$count % 50 == 0) {
if ($count != 0) {
$r->print('</table>'.$/);
@@ -293,7 +295,7 @@
($symb,$timestamp,$action,$machine,$values) = split(',',$line,5);
}
foreach ($symb,$timestamp,$student,$action,$machine) {
- $_=&Apache::lonnet::unescape($_);
+ $_=&unescape($_);
}
my ($title,$src);
if ($symb =~ m:^/adm/:) {
@@ -380,14 +382,14 @@
my %values=map {split('=',$_,-1)} split(/\&/,$values);
foreach my $key (sort(keys(%values))) {
$result.='<tr><td align="right">'.
- &Apache::lonnet::unescape($key).
+ &unescape($key).
'</td><td>=</td><td align="left">'.
- &Apache::lonnet::unescape($values{$key}).'</td></tr>';
+ &unescape($values{$key}).'</td></tr>';
}
$result.='</table>';
} elsif ($action eq 'POST') {
my %values=
- map {split('=',&Apache::lonnet::unescape($_),-1)} split(/\&/,$values);
+ map {split('=',&unescape($_),-1)} split(/\&/,$values);
foreach my $key (sort(keys(%values))) {
if ($key eq 'counter') { next; }
$result.='<tr><td align="right">'.$key.'</td>'.
@@ -395,7 +397,7 @@
}
$result.='</table>';
} else {
- $result=&Apache::lonnet::unescape($values)
+ $result=&unescape($values)
}
return $result;
}
Index: loncom/interface/lonwhatsnew.pm
diff -u loncom/interface/lonwhatsnew.pm:1.54 loncom/interface/lonwhatsnew.pm:1.55
--- loncom/interface/lonwhatsnew.pm:1.54 Mon May 1 15:37:34 2006
+++ loncom/interface/lonwhatsnew.pm Tue May 30 08:46:09 2006
@@ -1,5 +1,5 @@
#
-# $Id: lonwhatsnew.pm,v 1.54 2006/05/01 19:37:34 albertel Exp $
+# $Id: lonwhatsnew.pm,v 1.55 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -39,6 +39,8 @@
use Apache::Constants qw(:common :http);
use Time::Local;
use GDBM_File;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
#----------------------------
# handler
@@ -807,7 +809,7 @@
my @bombs = split(/,/, $errors);
my $errorcount = scalar(@bombs);
my $errorlink = '<a href="/adm/email?display='.
- &Apache::lonnet::escape($bombs[0]).'">'.
+ &escape($bombs[0]).'">'.
$title.'</a>';
$$bombed{$symb}{errorcount} = $errorcount;
$$bombed{$symb}{errorlink} = $errorlink;
@@ -870,8 +872,8 @@
$$triggered{$symb}{title} = $resource->title;
foreach my $part (@parts) {
if (exists($stats{$part}{users})) {
- my $resetname = 'reset_'.&Apache::lonnet::escape($symb."\0".$part);
- my $resettitle = 'title_'.&Apache::lonnet::escape($symb."\0".$part);
+ my $resetname = 'reset_'.&escape($symb."\0".$part);
+ my $resettitle = 'title_'.&escape($symb."\0".$part);
if ($$triggered{$symb}{numparts}) {
$$triggered{$symb}{text} .= '<tr bgcolor="'.$rowColor.'">'."\n";
}
@@ -887,7 +889,7 @@
<td align="right"><small>'.$stats{$part}{attempts}.'</small></td>
<td align="right"><small>'.$stats{$part}{degdiff}.'</small></td>
<td align="right"><small>'.$lastreset{$part}.'</small></td>
- <td align="right"><small><input type="checkbox" name="'.$resetname.'" /><input type="hidden" name="'.$resettitle.'" value="'.&Apache::lonnet::escape($$triggered{$symb}{title}).'" /></td>
+ <td align="right"><small><input type="checkbox" name="'.$resetname.'" /><input type="hidden" name="'.$resettitle.'" value="'.&escape($$triggered{$symb}{title}).'" /></td>
</tr>';
$$triggered{$symb}{numparts} ++;
}
@@ -958,8 +960,8 @@
my %titles = ();
foreach my $key (keys(%env)) {
next if ($key !~ /^form\.reset_(.+)$/);
- my $title = &Apache::lonnet::unescape($env{'form.title_'.$1});
- my $reset_item = &Apache::lonnet::unescape($1);
+ my $title = &unescape($env{'form.title_'.$1});
+ my $reset_item = &unescape($1);
my %curr_aggregates = &Apache::lonnet::dump('nohist_resourcetracker',$dom,$crs,$reset_item);
my %aggregates = ();
my ($symb,$part) = split(/\0/,$reset_item);
@@ -1017,7 +1019,7 @@
my @messages = sort(&Apache::lonnet::getkeys('nohist_email'));
foreach my $message (@messages) {
- my $msgid=&Apache::lonnet::escape($message);
+ my $msgid=&escape($message);
my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)=
&Apache::lonmsg::unpackmsgid($msgid);
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) {
@@ -1133,7 +1135,7 @@
}
my ($map,$id,$url)=&Apache::lonnet::decode_symb($res);
my $linkurl=&Apache::lonnet::clutter($url);
- $linkurl .= '?symb='.&Apache::lonnet::escape($res);
+ $linkurl .= '?symb='.&escape($res);
$r->print('<tr bgcolor="'.$rowColor.'"><td><a href="'.$linkurl.'"><small>'.$$ungraded{$res}{title}.'</small></a></td><td align="right"><small>'.$$ungraded{$res}{count}.'</small></td></tr>');
$rowNum ++;
@@ -1204,7 +1206,7 @@
if ($$triggered{$res}{numparts} > 1) {
$rowspan = 'rowspan="'.$$triggered{$res}{numparts}.'"';
}
- $linkurl .= '?symb='.&Apache::lonnet::escape($res);
+ $linkurl .= '?symb='.&escape($res);
$r->print('<tr bgcolor="'.$rowColor.'"><td '.$rowspan.'><a href="'.$linkurl.'"><small>'.$$triggered{$res}{title}.'</small></a></td>'.$$triggered{$res}{text});
$warningnum ++;
}
@@ -1238,7 +1240,7 @@
}
my ($map,$id,$url)=&Apache::lonnet::decode_symb($item);
my $linkurl=&Apache::lonnet::clutter($url);
- $linkurl .= '?symb='.&Apache::lonnet::escape($item);
+ $linkurl .= '?symb='.&escape($item);
$r->print('<tr bgcolor="'.$rowColor.'"><td><small><a href="'.$linkurl.'">'.$$res_title{$item}.'</a></small></td><td><small>'.$$changed{$item}{'revdate'}.'</small></td><td><small>'.$$changed{$item}{'current'}.'</small></td><td><small>'.$$changed{$item}{'version'}.'</small></td></tr>');
$changenum ++;
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.100 loncom/interface/portfolio.pm:1.101
--- loncom/interface/portfolio.pm:1.100 Thu May 18 16:29:00 2006
+++ loncom/interface/portfolio.pm Tue May 30 08:46:09 2006
@@ -31,6 +31,8 @@
use Apache::lonlocal;
use Apache::lonnet;
use Apache::longroup;
+use lib '/home/httpd/lib/perl';
+use LONCAPA;
# receives a file name and path stub from username/userfiles/portfolio/
# returns an anchor tag consisting encoding filename and currentpath
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.62 loncom/interface/slotrequest.pm:1.63
--- loncom/interface/slotrequest.pm:1.62 Thu May 18 16:53:24 2006
+++ loncom/interface/slotrequest.pm Tue May 30 08:46:09 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler for requesting to have slots added to a students record
#
-# $Id: slotrequest.pm,v 1.62 2006/05/18 20:53:24 albertel Exp $
+# $Id: slotrequest.pm,v 1.63 2006/05/30 12:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -36,6 +36,8 @@
use Apache::lonnet;
use Apache::lonnavmaps();
use Date::Manip;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
sub fail {
my ($r,$code)=@_;
@@ -763,7 +765,7 @@
$command='get';
}
}
- my $escsymb=&Apache::lonnet::escape($symb);
+ my $escsymb=&escape($symb);
$form=<<STUFF;
<form method="POST" action="/adm/slotrequest">
<input type="submit" name="Select" value="$text" />
@@ -862,11 +864,11 @@
undef($udom);
}
- $slotname = &Apache::lonnet::escape($slotname);
- $entry = &Apache::lonnet::escape($entry);
- $uname = &Apache::lonnet::escape($uname);
- $udom = &Apache::lonnet::escape($udom);
- $symb = &Apache::lonnet::escape($symb);
+ $slotname = &escape($slotname);
+ $entry = &escape($entry);
+ $uname = &escape($uname);
+ $udom = &escape($udom);
+ $symb = &escape($symb);
return <<"END_LINK";
<a href="/adm/slotrequest?command=remove_registration&slotname=$slotname&entry=$entry&uname=$uname&udom=$udom&symb=$symb"
@@ -1550,7 +1552,7 @@
&csv_upload_map($r);
}
} else {
- my $symb=&Apache::lonnet::unescape($env{'form.symb'});
+ my $symb=&unescape($env{'form.symb'});
if (!defined($symb)) {
&fail($r,'not_valid');
return OK;
Index: loncom/interface/spreadsheet/Spreadsheet.pm
diff -u loncom/interface/spreadsheet/Spreadsheet.pm:1.68 loncom/interface/spreadsheet/Spreadsheet.pm:1.69
--- loncom/interface/spreadsheet/Spreadsheet.pm:1.68 Mon May 1 02:17:16 2006
+++ loncom/interface/spreadsheet/Spreadsheet.pm Tue May 30 08:46:26 2006
@@ -1,5 +1,5 @@
#
-# $Id: Spreadsheet.pm,v 1.68 2006/05/01 06:17:16 raeburn Exp $
+# $Id: Spreadsheet.pm,v 1.69 2006/05/30 12:46:26 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -60,6 +60,9 @@
use Spreadsheet::WriteExcel;
use Time::HiRes;
use Apache::lonlocal;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
##
## Package Variables
@@ -1815,8 +1818,8 @@
my %f = $self->formulas();
while( my ($cell,$formula) = each(%f)) {
next if ($formula eq 'import');
- print $fh &Apache::lonnet::escape($cell)."=".
- &Apache::lonnet::escape($formula)."\n";
+ print $fh &escape($cell)."=".
+ &escape($formula)."\n";
}
$fh->close();
}
@@ -1834,8 +1837,8 @@
while (<$spreadsheet_file>) {
chomp;
my ($cell,$formula) = split(/=/);
- $cell = &Apache::lonnet::unescape($cell);
- $formula = &Apache::lonnet::unescape($formula);
+ $cell = &unescape($cell);
+ $formula = &unescape($formula);
$formulas{$cell} = $formula;
}
$spreadsheet_file->close();
Index: loncom/interface/spreadsheet/studentcalc.pm
diff -u loncom/interface/spreadsheet/studentcalc.pm:1.39 loncom/interface/spreadsheet/studentcalc.pm:1.40
--- loncom/interface/spreadsheet/studentcalc.pm:1.39 Mon May 1 02:17:16 2006
+++ loncom/interface/spreadsheet/studentcalc.pm Tue May 30 08:46:26 2006
@@ -1,5 +1,5 @@
#
-# $Id: studentcalc.pm,v 1.39 2006/05/01 06:17:16 raeburn Exp $
+# $Id: studentcalc.pm,v 1.40 2006/05/30 12:46:26 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -59,6 +59,9 @@
use HTML::Entities();
use Time::HiRes;
use Apache::lonlocal;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
@Apache::studentcalc::ISA = ('Apache::Spreadsheet');
@@ -292,7 +295,7 @@
'<a href="/adm/assesscalc?sname='.$self->{'name'}.
'&sdomain='.$self->{'domain'}.
'&filename='.$assess_filename.
- '&usymb='.&Apache::lonnet::escape($resource->symb).
+ '&usymb='.&escape($resource->symb).
'">'.$resource->compTitle.'</a><br />';
$row_output .= &assess_file_selector($rownum,
$assess_filename,
@@ -300,7 +303,7 @@
'</td>';
} else {
$row_output .= '<td><a href="'.$resource->src.'?symb='.
- &Apache::lonnet::escape($resource->symb).
+ &escape($resource->symb).
'">Go To</a>';
$row_output .= '</td><td>'.$resource->compTitle.'</td>';
}
Index: loncom/interface/statistics/lonclassifystudents.pm
diff -u loncom/interface/statistics/lonclassifystudents.pm:1.1 loncom/interface/statistics/lonclassifystudents.pm:1.2
--- loncom/interface/statistics/lonclassifystudents.pm:1.1 Sat Jul 27 16:50:15 2002
+++ loncom/interface/statistics/lonclassifystudents.pm Tue May 30 08:46:49 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# (Publication Handler
#
-# $Id: lonclassifystudents.pm,v 1.1 2002/07/27 20:50:15 minaeibi Exp $
+# $Id: lonclassifystudents.pm,v 1.2 2006/05/30 12:46:49 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -27,8 +27,6 @@
#
# (Navigate problems for statistical reports
#
-# YEAR=2002
-# 5/12,7/27 Behrouz Minaei
#
###
@@ -39,6 +37,9 @@
use Apache::lonhtmlcommon;
use Apache::loncoursedata;
use GDBM_File;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
#---- Activity log -------------------------------------------------------
@@ -163,7 +164,7 @@
my $count=0;
while ($line=<FILEID>) {
my ($time,$machine,$what)=split(':',$line);
- $what=&Apache::lonnet::unescape($what);
+ $what=&unescape($what);
my @accesses=split('&',$what);
foreach my $access (@accesses) {
@@ -172,7 +173,7 @@
my ($date,$resource,$who,$domain,$post,@posts)=split(':',$access);
if (!$resource) { next; }
- my $res=&Apache::lonnet::unescape($resource);
+ my $res=&unescape($resource);
if (($res =~ /\.problem/)) {
$Activity->{$who.':'.$res}.=$date.'@';
#$r->print('<br>'.$time.':'.$who.'---'.$res);
@@ -201,20 +202,20 @@
my $Count=0;
while ($line=<FILEID>) {
my ($time,$machine,$what)=split(':',$line);
- $what=&Apache::lonnet::unescape($what);
+ $what=&unescape($what);
my @accesses=split('&',$what);
foreach my $access (@accesses) {
my ($date,$resource,$who,$domain,$post,@posts)=split(':',$access);
#if ($who ne $userid) { next; }
if (!$resource) { next; }
- my $res=&Apache::lonnet::unescape($resource);
+ my $res=&unescape($resource);
if (($res =~ /\.(sequence|problem|htm|html|page)/)) {
$Count++;
###888 $r->print("<br>$Count) ".localtime($date).": $who --> $res");
# if ($post) {
# $Count++;
# $r->print("<br><b>$Count) Sent data ".join(':',
-# &Apache::lonnet::unescape(@posts)).'</b>');
+# &unescape(@posts)).'</b>');
# }
###888 $r->rflush();
}
Index: loncom/interface/statistics/lonpercentage.pm
diff -u loncom/interface/statistics/lonpercentage.pm:1.9 loncom/interface/statistics/lonpercentage.pm:1.10
--- loncom/interface/statistics/lonpercentage.pm:1.9 Tue Feb 25 15:47:47 2003
+++ loncom/interface/statistics/lonpercentage.pm Tue May 30 08:46:49 2006
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonpercentage.pm,v 1.9 2003/02/25 20:47:47 matthew Exp $
+# $Id: lonpercentage.pm,v 1.10 2006/05/30 12:46:49 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -32,6 +32,9 @@
use Apache::lonhtmlcommon;
use Apache::loncoursedata;
use GDBM_File;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
sub BuildPercentageGraph {
@@ -327,9 +330,9 @@
foreach my $name (sort(split(':::', $percentage->{$_}))) {
$Ptr .= '<a href="/adm/statistics?reportSelected=';
- $Ptr .= &Apache::lonnet::escape('Student Assessment');
+ $Ptr .= &escape('Student Assessment');
$Ptr .= '&StudentAssessmentStudent=';
- $Ptr .= &Apache::lonnet::escape($cache->{$name.':fullname'}).'">';
+ $Ptr .= &escape($cache->{$name.':fullname'}).'">';
$Ptr .= $cache->{$name.':fullname'};
$Ptr .= '</a>,  ';
}
Index: loncom/interface/statistics/lonproblemanalysis.pm
diff -u loncom/interface/statistics/lonproblemanalysis.pm:1.125 loncom/interface/statistics/lonproblemanalysis.pm:1.126
--- loncom/interface/statistics/lonproblemanalysis.pm:1.125 Mon May 1 15:29:13 2006
+++ loncom/interface/statistics/lonproblemanalysis.pm Tue May 30 08:46:49 2006
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemanalysis.pm,v 1.125 2006/05/01 19:29:13 albertel Exp $
+# $Id: lonproblemanalysis.pm,v 1.126 2006/05/30 12:46:49 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,6 +38,9 @@
use HTML::Entities();
use Time::Local();
use capa;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
my $plotcolors = ['#33ff00',
'#0033cc', '#990000', '#aaaa66', '#663399', '#ff9933',
@@ -794,7 +797,7 @@
my ($idx,@remainder) = split('&',$student->{'answer'});
my ($answer) = ($remainder[$idx]=~/^(.*)=([^=]*)$/);
$correct->{$student->{'username'}.':'.$student->{'domain'}}=
- &Apache::lonnet::unescape($answer);
+ &unescape($answer);
}
} else {
foreach my $foil (keys(%$foildata)) {
@@ -1928,7 +1931,7 @@
my %attempt;
$attempt{'student'} = $row->[&Apache::loncoursedata::RD_sname()];
$attempt{'tries'} = $row->[&Apache::loncoursedata::RD_tries()];
- $attempt{'submission'} = &Apache::lonnet::unescape($row->[&Apache::loncoursedata::RD_submission()]);
+ $attempt{'submission'} = &unescape($row->[&Apache::loncoursedata::RD_submission()]);
$attempt{'award'} = $row->[&Apache::loncoursedata::RD_awarddetail()];
$attempt{'timestamp'} = $row->[&Apache::loncoursedata::RD_timestamp()];
return %attempt;
@@ -1952,12 +1955,12 @@
my @Foilsubs = split('&',$submission);
for (my $j=0;$j<=$#Foilgrades;$j++) {
my ($foilid,$correct) = split('=',$Foilgrades[$j]);
- $foilid = &Apache::lonnet::unescape($foilid);
+ $foilid = &unescape($foilid);
my (undef,$submission) = split('=',$Foilsubs[$j]);
if ($correct) {
$RowData{$foilid}->{'_correct'}++;
} else {
- $submission = &Apache::lonnet::unescape($submission);
+ $submission = &unescape($submission);
$RowData{$foilid}->{$submission}++;
}
$RowData{$foilid}->{'_total'}++;
Index: loncom/interface/statistics/lonproblemstatistics.pm
diff -u loncom/interface/statistics/lonproblemstatistics.pm:1.108 loncom/interface/statistics/lonproblemstatistics.pm:1.109
--- loncom/interface/statistics/lonproblemstatistics.pm:1.108 Fri May 5 16:03:43 2006
+++ loncom/interface/statistics/lonproblemstatistics.pm Tue May 30 08:46:50 2006
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemstatistics.pm,v 1.108 2006/05/05 20:03:43 raeburn Exp $
+# $Id: lonproblemstatistics.pm,v 1.109 2006/05/30 12:46:50 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -60,6 +60,9 @@
use Spreadsheet::WriteExcel;
use Apache::lonstathelpers();
use Time::HiRes;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
my @StatsArray;
my %SeqStat; # keys are symbs, values are hash refs
@@ -1565,7 +1568,7 @@
$data->{'container'} = $sequence->compTitle;
$data->{'title'} = $resource->compTitle;
$data->{'title.link'} = $resource->src.'?symb='.
- &Apache::lonnet::escape($resource->symb);
+ &escape($resource->symb);
#
if ($SelectedFields{'deg_of_disc'}) {
$data->{'deg_of_disc'} =
Index: loncom/interface/statistics/lonstathelpers.pm
diff -u loncom/interface/statistics/lonstathelpers.pm:1.52 loncom/interface/statistics/lonstathelpers.pm:1.53
--- loncom/interface/statistics/lonstathelpers.pm:1.52 Tue Feb 14 11:05:46 2006
+++ loncom/interface/statistics/lonstathelpers.pm Tue May 30 08:46:50 2006
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstathelpers.pm,v 1.52 2006/02/14 16:05:46 albertel Exp $
+# $Id: lonstathelpers.pm,v 1.53 2006/05/30 12:46:50 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -60,6 +60,9 @@
use Spreadsheet::WriteExcel();
use GDBM_File;
use Storable qw(freeze thaw);
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
####################################################
####################################################
@@ -83,7 +86,7 @@
## Render the problem
my ($base) = ($resource->src =~ m|^(.*/)[^/]*$|);
$base="http://".$ENV{'SERVER_NAME'}.$base;
- my ($src,$symb)=($resource->src,&Apache::lonnet::escape($resource->symb));
+ my ($src,$symb)=($resource->src,&escape($resource->symb));
my $rendered_problem = &Apache::lonnet::ssi_body($src.'?symb='.$symb);
$rendered_problem =~ s/<\s*form\s*/<nop /g;
$rendered_problem =~ s|(<\s*/form\s*>)|<\/nop>|g;
@@ -169,7 +172,7 @@
$seq_str .= &mt('response').' '.$respid;
}
my $link = $res->src.'?symb='.
- &Apache::lonnet::escape($res->symb);
+ &escape($res->symb);
$seq_str .= (' 'x2).
qq{<a target="preview" href="$link">view</a>};
$seq_str .= "</td></tr>\n";
@@ -323,11 +326,11 @@
}
$target .= 'id="'.$seq_id.':'.$item_id++.'" ';
$target.=
- 'value="'.&Apache::lonnet::escape($res->symb).'" />'.
+ 'value="'.&escape($res->symb).'" />'.
' '.$res->compTitle.'</label>'.
(' 'x2).'<a target="preview" '.
'href="'.$res->src.'?symb='.
- &Apache::lonnet::escape($res->symb).'">view</a>'.
+ &escape($res->symb).'">view</a>'.
'</td></tr>'.$/;
} else {
if (defined($target)) {
@@ -346,7 +349,7 @@
my ($inputfield) = @_;
my $field = 'form.'.$inputfield;
my @symbs = (map {
- &Apache::lonnet::unescape($_);
+ &unescape($_);
} &Apache::loncommon::get_env_multiple($field));
return @symbs;
}
@@ -373,10 +376,10 @@
####################################################
sub make_target_id {
my ($target) = @_;
- my $id = &Apache::lonnet::escape($target->{'symb'}).':'.
- &Apache::lonnet::escape($target->{'part'}).':'.
- &Apache::lonnet::escape($target->{'respid'}).':'.
- &Apache::lonnet::escape($target->{'resptype'});
+ my $id = &escape($target->{'symb'}).':'.
+ &escape($target->{'part'}).':'.
+ &escape($target->{'respid'}).':'.
+ &escape($target->{'resptype'});
return $id;
}
@@ -401,18 +404,18 @@
my ($id) = @_;
if (! ref($id)) {
my ($symb,$part,$respid,$resptype) = split(':',$id);
- return ({ symb => &Apache::lonnet::unescape($symb),
- part => &Apache::lonnet::unescape($part),
- respid => &Apache::lonnet::unescape($respid),
- resptype => &Apache::lonnet::unescape($resptype)});
+ return ({ symb => &unescape($symb),
+ part => &unescape($part),
+ respid => &unescape($respid),
+ resptype => &unescape($resptype)});
} elsif (ref($id) eq 'ARRAY') {
my @Return;
foreach my $selected (@$id) {
my ($symb,$part,$respid,$resptype) = split(':',$selected);
- push(@Return,{ symb => &Apache::lonnet::unescape($symb),
- part => &Apache::lonnet::unescape($part),
- respid => &Apache::lonnet::unescape($respid),
- resptype => &Apache::lonnet::unescape($resptype)});
+ push(@Return,{ symb => &unescape($symb),
+ part => &unescape($part),
+ respid => &unescape($respid),
+ resptype => &unescape($resptype)});
}
return \@Return;
}
@@ -795,7 +798,7 @@
my $storedstring;
my %cache_db;
if (tie(%cache_db,'GDBM_File',$cache_filename,&GDBM_READER(),0640)) {
- $storedstring = $cache_db{&Apache::lonnet::escape($symb)};
+ $storedstring = $cache_db{&escape($symb)};
untie(%cache_db);
}
if (defined($storedstring)) {
@@ -847,7 +850,7 @@
sub write_analysis_cache {
return if (! defined($current_symb) || ! defined($cache_filename));
my %cache_db;
- my $key = &Apache::lonnet::escape($current_symb);
+ my $key = &escape($current_symb);
if (tie(%cache_db,'GDBM_File',$cache_filename,&GDBM_WRCREAT(),0640)) {
my $storestring = freeze(\%cache);
$cache_db{$key}=$storestring;
@@ -1310,7 +1313,7 @@
my $sectionkey =
join(',',
map {
- &Apache::lonnet::escape($_);
+ &escape($_);
} sort(&Apache::lonstatistics::get_selected_sections())
);
my $statuskey = $Apache::lonstatistics::enrollment_status;
Index: loncom/interface/statistics/lonstudentassessment.pm
diff -u loncom/interface/statistics/lonstudentassessment.pm:1.139 loncom/interface/statistics/lonstudentassessment.pm:1.140
--- loncom/interface/statistics/lonstudentassessment.pm:1.139 Fri May 5 16:03:43 2006
+++ loncom/interface/statistics/lonstudentassessment.pm Tue May 30 08:46:50 2006
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstudentassessment.pm,v 1.139 2006/05/05 20:03:43 raeburn Exp $
+# $Id: lonstudentassessment.pm,v 1.140 2006/05/30 12:46:50 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -61,6 +61,9 @@
use Time::HiRes;
use Spreadsheet::WriteExcel;
use Spreadsheet::WriteExcel::Utility();
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
#######################################################
#######################################################
@@ -1946,7 +1949,7 @@
&Apache::lonnet::logthis('length of symbol "'.$symbol.'" > 1');
}
my $link = '/adm/grades'.
- '?symb='.&Apache::lonnet::escape($resource->symb).
+ '?symb='.&escape($resource->symb).
'&student='.$student->{'username'}.
'&userdom='.$student->{'domain'}.
'&command=submission';
@@ -2101,7 +2104,7 @@
#
if ( ($links eq 'yes' && $symbol ne ' ') || ($links eq 'all')) {
my $link = '/adm/grades' .
- '?symb='.&Apache::lonnet::escape($symb).
+ '?symb='.&escape($symb).
'&student='.$student->{'username'}.
'&userdom='.$student->{'domain'}.
'&command=submission';
Index: loncom/interface/statistics/lonstudentsubmissions.pm
diff -u loncom/interface/statistics/lonstudentsubmissions.pm:1.44 loncom/interface/statistics/lonstudentsubmissions.pm:1.45
--- loncom/interface/statistics/lonstudentsubmissions.pm:1.44 Fri May 5 16:03:43 2006
+++ loncom/interface/statistics/lonstudentsubmissions.pm Tue May 30 08:46:50 2006
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstudentsubmissions.pm,v 1.44 2006/05/05 20:03:43 raeburn Exp $
+# $Id: lonstudentsubmissions.pm,v 1.45 2006/05/30 12:46:50 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -37,6 +37,9 @@
use HTML::Entities();
use Time::Local();
use Spreadsheet::WriteExcel();
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
my @SubmitButtons = ({ name => 'SelectAnother',
text => 'Choose a different Problem' },
@@ -555,7 +558,7 @@
return '';
}
#
- my $submission = &HTML::Entities::decode(&Apache::lonnet::unescape($response->{'Submission'}));
+ my $submission = &HTML::Entities::decode(&unescape($response->{'Submission'}));
return '' if (! defined($submission) || $submission eq '');
$submission =~ s/\\\"/\"/g;
$submission =~ s/\\\'/\'/g;
@@ -570,14 +573,14 @@
if ($resptype =~ /^(option|match|rank)$/) {
my %submission =
map {
- my ($foil,$value) = split('=',&Apache::lonnet::unescape($_));
+ my ($foil,$value) = split('=',&unescape($_));
($foil,$value);
} split('&',$response->{'Submission'});
my %correct;
if (exists($response->{'Correct'})) {
%correct =
map {
- my ($foil,$value)=split('=',&Apache::lonnet::unescape($_));
+ my ($foil,$value)=split('=',&unescape($_));
($foil,$value);
} split('&',$response->{'Correct'});
}
@@ -828,7 +831,7 @@
#
my $submission =
&HTML::Entities::decode
- (&Apache::lonnet::unescape($response->{'Submission'}));
+ (&unescape($response->{'Submission'}));
if (!$prob->is_task()) {
return () if (! defined($submission) || $submission eq '');
}
@@ -843,14 +846,14 @@
if ($resptype =~ /^(option|match|rank)$/) {
my %submission =
map {
- my ($foil,$value) = split('=',&Apache::lonnet::unescape($_));
+ my ($foil,$value) = split('=',&unescape($_));
($foil,$value);
} split('&',$response->{'Submission'});
my %correct;
if (exists($response->{'Correct'})) {
%correct =
map {
- my ($foil,$value)=split('=',&Apache::lonnet::unescape($_));
+ my ($foil,$value)=split('=',&unescape($_));
($foil,$value);
} split('&',$response->{'Correct'});
}
Index: loncom/interface/statistics/lonsurveyreports.pm
diff -u loncom/interface/statistics/lonsurveyreports.pm:1.12 loncom/interface/statistics/lonsurveyreports.pm:1.13
--- loncom/interface/statistics/lonsurveyreports.pm:1.12 Fri May 5 16:03:43 2006
+++ loncom/interface/statistics/lonsurveyreports.pm Tue May 30 08:46:50 2006
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonsurveyreports.pm,v 1.12 2006/05/05 20:03:43 raeburn Exp $
+# $Id: lonsurveyreports.pm,v 1.13 2006/05/30 12:46:50 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -37,6 +37,9 @@
use Spreadsheet::WriteExcel;
use HTML::Entities();
use Time::Local();
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
my @SubmitButtons = (
{ name => 'break'},
@@ -201,7 +204,7 @@
$checked = 'checked ';
}
my $link = $problem->{'res'}->src.
- '?symb='.&Apache::lonnet::escape($problem->{'res'}->symb);
+ '?symb='.&escape($problem->{'res'}->symb);
$Str .= '<tr><td>'.
'<input type="radio" name="problemchoice" id="'.$id.'" '.
'value="'.$value.'" '.$checked.'/>'.'</td>'.
@@ -249,13 +252,13 @@
foreach my $response (@responses) {
my ($foilid,$option) =
map {
- &Apache::lonnet::unescape($_);
+ &unescape($_);
} split('=',$response);
$data->{'foil_count'}->{$foilid}++;
$data->{'foil_responses'}->{$foilid}->{$option}++;
}
} elsif ($resptype =~ /^(radiobutton)$/) {
- my ($foil,$value) = map { &Apache::lonnet::unescape($_); } split('=',$student_response);
+ my ($foil,$value) = map { &unescape($_); } split('=',$student_response);
$value += 1; # explicitly increment it...
$data->{'foil_responses'}->{$foil}++;
$data->{'foil_values'}->{$value}++;
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.739 loncom/lonnet/perl/lonnet.pm:1.740
--- loncom/lonnet/perl/lonnet.pm:1.739 Wed May 17 21:08:54 2006
+++ loncom/lonnet/perl/lonnet.pm Tue May 30 08:47:18 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.739 2006/05/18 01:08:54 raeburn Exp $
+# $Id: lonnet.pm,v 1.740 2006/05/30 12:47:18 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -52,6 +52,9 @@
use Time::HiRes qw( gettimeofday tv_interval );
use Cache::Memcached;
use Digest::MD5;
+use lib '/home/httpd/lib/perl';
+use LONCAPA;
+use LONCAPA::Configuration;
my $readit;
my $max_connection_retries = 10; # Or some such value.
@@ -1952,8 +1955,8 @@
sub dcmailput {
my ($domain,$msgid,$message,$server)=@_;
my $status = &Apache::lonnet::critical(
- 'dcmailput:'.$domain.':'.&Apache::lonnet::escape($msgid).'='.
- &Apache::lonnet::escape($message),$server);
+ 'dcmailput:'.$domain.':'.&escape($msgid).'='.
+ &escape($message),$server);
return $status;
}
@@ -4824,7 +4827,7 @@
($udom,$uname,$file) =
($uri =~ m-/(?:uploaded|editupload)/?([^/]*)/?([^/]*)/?(.*)-);
$file = 'userfiles/'.$file;
- $dir = &Apache::loncommon::propath($udom,$uname);
+ $dir = &propath($udom,$uname);
}
if ($uri =~ m-^/res/-) {
($udom,$uname) =
@@ -6460,7 +6463,7 @@
my @ids=¤t_machine_ids();
foreach my $id (@ids) { if ($id eq $home) { $is_me=1; } }
if ($is_me) {
- $location=&Apache::loncommon::propath($udom,$uname).
+ $location=&propath($udom,$uname).
'/userfiles/'.$filename;
} else {
$location=$Apache::lonnet::perlvar{'lonDocRoot'}.'/userfiles/'.
@@ -6581,21 +6584,6 @@
return &escape($value);
}
-# -------------------------------------------------------- Escape Special Chars
-
-sub escape {
- my $str=shift;
- $str =~ s/(\W)/"%".unpack('H2',$1)/eg;
- return $str;
-}
-
-# ----------------------------------------------------- Un-Escape Special Chars
-
-sub unescape {
- my $str=shift;
- $str =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
- return $str;
-}
sub thaw_unescape {
my ($value)=@_;
Index: loncom/publisher/loncfile.pm
diff -u loncom/publisher/loncfile.pm:1.76 loncom/publisher/loncfile.pm:1.77
--- loncom/publisher/loncfile.pm:1.76 Thu Apr 13 14:30:30 2006
+++ loncom/publisher/loncfile.pm Tue May 30 08:47:41 2006
@@ -9,7 +9,7 @@
# and displays a page showing the results of the action.
#
#
-# $Id: loncfile.pm,v 1.76 2006/04/13 18:30:30 albertel Exp $
+# $Id: loncfile.pm,v 1.77 2006/05/30 12:47:41 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -72,6 +72,9 @@
use Apache::lonnet;
use Apache::loncommon();
use Apache::lonlocal;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
my $DEBUG=0;
my $r; # Needs to be global for some stuff RF.
@@ -1229,12 +1232,12 @@
if ($env{'form.filename'}) {
&Debug($r, "test: $env{'form.filename'}");
- $fn=&Apache::lonnet::unescape($env{'form.filename'});
+ $fn=&unescape($env{'form.filename'});
$fn=&URLToPath($fn);
} elsif($ENV{'QUERY_STRING'} && $env{'form.phase'} ne 'two') {
#Just hijack the script only the first time around to inject the
#correct information for further processing
- $fn=&Apache::lonnet::unescape($env{'form.decompress'});
+ $fn=&unescape($env{'form.decompress'});
$fn=&URLToPath($fn);
$env{'form.action'}="decompress";
} elsif ($env{'form.qualifiedfilename'}) {
Index: loncom/publisher/loncleanup.pm
diff -u loncom/publisher/loncleanup.pm:1.7 loncom/publisher/loncleanup.pm:1.8
--- loncom/publisher/loncleanup.pm:1.7 Thu Apr 6 18:15:18 2006
+++ loncom/publisher/loncleanup.pm Tue May 30 08:47:41 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to cleanup XML files
#
-# $Id: loncleanup.pm,v 1.7 2006/04/06 22:15:18 albertel Exp $
+# $Id: loncleanup.pm,v 1.8 2006/05/30 12:47:41 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,6 +38,9 @@
use Apache::loncommon();
use Apache::lonlocal;
use Apache::lonnet;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
sub latextrans {
my $symbolfont=shift;
@@ -294,9 +297,9 @@
$warningcount.' '.&mt('warning(s)').
'<br /><a href="'.$newuri.'" target="prev">'.
&mt('Open (and edit) cleaned up file in new window').'</a>'.
- '<br /><a href="/adm/diff?filename='.&Apache::lonnet::escape($uri).
+ '<br /><a href="/adm/diff?filename='.&escape($uri).
'&versionone=priv&filetwo='.
- &Apache::lonnet::escape($newuri).'" target="prev">'.
+ &escape($newuri).'" target="prev">'.
&mt('Show diffs in new window').'</a><br />'.
'<input type="hidden" name="phase" value="three" />'.
'<input type="submit" name="accept" value="'.&mt('Accept Result').'" />'.
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.208 loncom/publisher/lonpublisher.pm:1.209
--- loncom/publisher/lonpublisher.pm:1.208 Thu Apr 6 18:15:18 2006
+++ loncom/publisher/lonpublisher.pm Tue May 30 08:47:41 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.208 2006/04/06 22:15:18 albertel Exp $
+# $Id: lonpublisher.pm,v 1.209 2006/05/30 12:47:41 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -129,6 +129,9 @@
use LONCAPA::lonmetadata;
use Apache::lonmsg;
use vars qw(%metadatafields %metadatakeys);
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
my %addid;
my %nokey;
@@ -1168,7 +1171,7 @@
'<p>'.($env{'form.makeobsolete'}?'':'<input type="submit" value="'.&mt('Finalize Publication').'" />').'</p>'.
&hiddenfield('phase','two').
&hiddenfield('filename',$env{'form.filename'}).
- &hiddenfield('allmeta',&Apache::lonnet::escape($allmeta)).
+ &hiddenfield('allmeta',&escape($allmeta)).
&hiddenfield('dependencies',join(',',keys %allow));
unless ($env{'form.makeobsolete'}) {
$intr_scrout.=
@@ -1441,7 +1444,7 @@
%metadatafields=();
%metadatakeys=();
- &metaeval(&Apache::lonnet::unescape($env{'form.allmeta'}));
+ &metaeval(&unescape($env{'form.allmeta'}));
$metadatafields{'title'}=$env{'form.title'};
$metadatafields{'author'}=$env{'form.author'};
@@ -1947,7 +1950,7 @@
@{$modified_urls}=();
# -------------------------------------------------------------- Check filename
- my $fn=&Apache::lonnet::unescape($env{'form.filename'});
+ my $fn=&unescape($env{'form.filename'});
($cuname,$cudom)=
&Apache::loncacc::constructaccess($fn,$r->dir_config('lonDefDomain'));
Index: loncom/xml/lonplot.pm
diff -u loncom/xml/lonplot.pm:1.112 loncom/xml/lonplot.pm:1.113
--- loncom/xml/lonplot.pm:1.112 Thu Dec 1 13:46:17 2005
+++ loncom/xml/lonplot.pm Tue May 30 08:47:53 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Dynamic plot
#
-# $Id: lonplot.pm,v 1.112 2005/12/01 18:46:17 albertel Exp $
+# $Id: lonplot.pm,v 1.113 2006/05/30 12:47:53 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -36,6 +36,9 @@
use Apache::lonxml;
use Apache::edit;
use Apache::lonnet;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
use vars qw/$weboutputformat $versionstring/;
@@ -574,7 +577,7 @@
'_'.time.'_'.$$.$randnumber.'_plot';
## Write the plot description to the file
&write_gnuplot_file($tmpdir,$filename,$target);
- $filename = &Apache::lonnet::escape($filename);
+ $filename = &escape($filename);
## return image tag for the plot
if ($target eq 'web') {
$result .= <<"ENDIMAGE";
@@ -591,7 +594,7 @@
&Apache::lonxml::register_ssi("/cgi-bin/plot.gif?file=$filename.data&output=eps");
$result = "%DYNAMICIMAGE:$Apache::lonplot::plot{'width'}:$Apache::lonplot::plot{'height'}:$Apache::lonplot::plot{'texwidth'}\n";
$result .= '\graphicspath{{/home/httpd/perl/tmp/}}'."\n";
- $result .= '\includegraphics[width='.$Apache::lonplot::plot{'texwidth'}.' mm]{'.&Apache::lonnet::unescape($filename).'.eps}';
+ $result .= '\includegraphics[width='.$Apache::lonplot::plot{'texwidth'}.' mm]{'.&unescape($filename).'.eps}';
}
} elsif ($target eq 'edit') {
$result.=&Apache::edit::tag_end($target,$token);
@@ -1108,7 +1111,7 @@
} elsif ($target eq 'tex') {
$gnuplot_input .= "set term postscript eps $Apache::lonplot::plot{'plotcolor'} solid \"Helvetica\" $pt \n";
$gnuplot_input .= "set output \"/home/httpd/perl/tmp/".
- &Apache::lonnet::unescape($filename).".eps\"\n";
+ &unescape($filename).".eps\"\n";
}
# cartesian or polar?
if (lc($Apache::lonplot::plot{'plottype'}) eq 'polar') {
Index: loncom/xml/lontexconvert.pm
diff -u loncom/xml/lontexconvert.pm:1.74 loncom/xml/lontexconvert.pm:1.75
--- loncom/xml/lontexconvert.pm:1.74 Thu May 18 18:13:50 2006
+++ loncom/xml/lontexconvert.pm Tue May 30 08:47:53 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# TeX Conversion Module
#
-# $Id: lontexconvert.pm,v 1.74 2006/05/18 22:13:50 albertel Exp $
+# $Id: lontexconvert.pm,v 1.75 2006/05/30 12:47:53 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -45,6 +45,9 @@
#use Apache::lonxml();
use Apache::lonlocal;
use Apache::lonnet;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
# ====================================================================== Header
@@ -211,7 +214,7 @@
if ($displaystyle) {
$$texstring='\\displaystyle \\Large '.$$texstring;
}
- my $result='<img src="/cgi-bin/mimetex.cgi?'.&Apache::lonnet::escape($$texstring).'" />';
+ my $result='<img src="/cgi-bin/mimetex.cgi?'.&escape($$texstring).'" />';
if ($displaystyle) {
$result='<center>'.$result.'</center>';
}
--www1148993281--