version 1.27, 2008/11/20 15:19:33
|
version 1.30, 2010/06/15 05:31:43
|
Line 44 my $loncapa_max_wait_time = 13;
|
Line 44 my $loncapa_max_wait_time = 13;
|
use vars qw($match_domain $match_not_domain |
use vars qw($match_domain $match_not_domain |
$match_username $match_not_username |
$match_username $match_not_username |
$match_courseid $match_not_courseid |
$match_courseid $match_not_courseid |
|
$match_community |
$match_name |
$match_name |
$match_lonid |
$match_lonid |
$match_handle $match_not_handle); |
$match_handle $match_not_handle); |
Line 56 our @EXPORT = qw(&add_get_param &esca
|
Line 57 our @EXPORT = qw(&add_get_param &esca
|
our @EXPORT_OK = qw($match_domain $match_not_domain |
our @EXPORT_OK = qw($match_domain $match_not_domain |
$match_username $match_not_username |
$match_username $match_not_username |
$match_courseid $match_not_courseid |
$match_courseid $match_not_courseid |
|
$match_community |
$match_name |
$match_name |
$match_lonid |
$match_lonid |
$match_handle $match_not_handle); |
$match_handle $match_not_handle); |
our %EXPORT_TAGS = ( 'match' =>[qw($match_domain $match_not_domain |
our %EXPORT_TAGS = ( 'match' =>[qw($match_domain $match_not_domain |
$match_username $match_not_username |
$match_username $match_not_username |
$match_courseid $match_not_courseid |
$match_courseid $match_not_courseid |
|
$match_community |
$match_name |
$match_name |
$match_lonid |
$match_lonid |
$match_handle $match_not_handle)],); |
$match_handle $match_not_handle)],); |
my %perlvar; |
my %perlvar; |
|
|
|
|
=pod |
|
|
|
=head2 NOTE: |
|
|
|
add_get_param() |
|
|
|
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 |
|
needed |
|
|
|
=cut |
|
|
|
sub add_get_param { |
sub add_get_param { |
my ($url,$form_data) = @_; |
my ($url,$form_data) = @_; |
my $needs_question_mark = ($url !~ /\?/); |
my $needs_question_mark = ($url !~ /\?/); |
Line 114 sub unescape {
|
Line 103 sub unescape {
|
return $str; |
return $str; |
} |
} |
|
|
$match_domain = $LONCAPA::domain_re = qr{[\w\-.]+}; |
$match_domain = $LONCAPA::domain_re = qr{[[:alnum:]\-.]+}; |
$match_not_domain = $LONCAPA::not_domain_re = qr{[^\w\-.]+}; |
$match_not_domain = $LONCAPA::not_domain_re = qr{[^[:alnum:]\-.]+}; |
sub clean_domain { |
sub clean_domain { |
my ($domain) = @_; |
my ($domain) = @_; |
$domain =~ s/$match_not_domain//g; |
$domain =~ s/$match_not_domain//g; |
Line 133 sub clean_username {
|
Line 122 sub clean_username {
|
|
|
|
|
$match_courseid = $LONCAPA::courseid_re = qr{\d[\w\-.]+}; |
$match_courseid = $LONCAPA::courseid_re = qr{\d[\w\-.]+}; |
|
$match_community =$LONCAPA::community_re = qr{0[\w\-.]+}; |
$match_not_courseid = $LONCAPA::not_courseid_re = qr{[^\w\-.]+}; |
$match_not_courseid = $LONCAPA::not_courseid_re = qr{[^\w\-.]+}; |
sub clean_courseid { |
sub clean_courseid { |
my ($courseid) = @_; |
my ($courseid) = @_; |
Line 175 sub propath {
|
Line 165 sub propath {
|
$subdir =~ s/(.)(.)(.).*/$1\/$2\/$3/; |
$subdir =~ s/(.)(.)(.).*/$1\/$2\/$3/; |
my $proname="$perlvar{'lonUsersDir'}/$udom/$subdir/$uname"; |
my $proname="$perlvar{'lonUsersDir'}/$udom/$subdir/$uname"; |
return $proname; |
return $proname; |
} |
} |
|
|
|
|
sub tie_domain_hash { |
sub tie_domain_hash { |
my ($domain,$namespace,$how,$loghead,$logtail) = @_; |
my ($domain,$namespace,$how,$loghead,$logtail) = @_; |
Line 385 BEGIN {
|
Line 374 BEGIN {
|
|
|
__END__ |
__END__ |
|
|
|
=pod |
|
|
=head1 NAME |
=head1 NAME |
|
|
Line 409 unpack non-word characters into CGI-comp
|
Line 399 unpack non-word characters into CGI-comp
|
pack CGI-compatible hex codes into actual non-word ASCII character |
pack CGI-compatible hex codes into actual non-word ASCII character |
|
|
=item add_get_param() |
=item add_get_param() |
|
|
|
Append escaped form elements (name=value etc.) to a url. |
|
|
Inputs: url (with or without exit GET from parameters), hash ref of |
Inputs: url (with or without exit GET from parameters), hash ref of |
form name => value pairs |
form name => value pairs |
|
|
Return: url with properly added the form name elements and values to the |
Return: url with form name elements and values appended to the |
the url doing proper escaping of the values and joining with ? or & |
the url, doing proper escaping of the values and joining with ? or & |
as needed |
as needed |
|
|
=item clean_handle() |
=item clean_handle() |