[LON-CAPA-cvs] cvs: loncom /auth lonacc.pm
raeburn
lon-capa-cvs-allow@mail.lon-capa.org
Sat, 08 Mar 2008 02:45:14 -0000
raeburn Fri Mar 7 21:45:14 2008 EDT
Modified files:
/loncom/auth lonacc.pm
Log:
- &get_posted_cgi() can take second (optional) argument - a reference to an array of the names of form elements which may be retrieved from a submitted form (method was "post").
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.113 loncom/auth/lonacc.pm:1.114
--- loncom/auth/lonacc.pm:1.113 Mon Nov 5 21:42:40 2007
+++ loncom/auth/lonacc.pm Fri Mar 7 21:45:14 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Cookie Based Access Handler
#
-# $Id: lonacc.pm,v 1.113 2007/11/06 02:42:40 albertel Exp $
+# $Id: lonacc.pm,v 1.114 2008/03/08 02:45:14 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -57,7 +57,7 @@
###############################################
sub get_posted_cgi {
- my ($r) = @_;
+ my ($r,$fields) = @_;
my $buffer;
if ($r->header_in('Content-length')) {
@@ -73,6 +73,9 @@
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
+ if (ref($fields) eq 'ARRAY') {
+ next if (!grep(/^\Q$name\E$/,@{$fields}));
+ }
&Apache::loncommon::add_to_env("form.$name",$value);
}
} else {
@@ -93,6 +96,9 @@
} else {
$value=~s/\s+$//s;
}
+ if (ref($fields) eq 'ARRAY') {
+ next if (!grep(/^\Q$name\E$/,@{$fields}));
+ }
&Apache::loncommon::add_to_env("form.$name",$value);
}
if ($i<$#lines) {