version 1.119, 2008/11/18 19:14:34
|
version 1.122, 2008/11/29 10:34:30
|
Line 87 store attempted access
|
Line 87 store attempted access
|
|
|
=back |
=back |
|
|
|
=head1 NOTABLE SUBROUTINES |
|
|
|
=over |
|
|
=cut |
=cut |
|
|
|
|
Line 218 sub get_posted_cgi {
|
Line 222 sub get_posted_cgi {
|
$r->headers_in->unset('Content-length'); |
$r->headers_in->unset('Content-length'); |
} |
} |
|
|
# |
=pod |
# Perform size checks for file uploads to essayresponse items in course context. |
|
# |
=item upload_size_allowed() |
# Add form.HWFILESIZE.$part_$id to %env with file size (MB) |
|
# If file exceeds maximum allowed size, add form.HWFILETOOBIG.$part_$id to %env. |
Perform size checks for file uploads to essayresponse items in course context. |
# |
|
|
Add form.HWFILESIZE.$part_$id to %env with file size (MB) |
|
If file exceeds maximum allowed size, add form.HWFILETOOBIG.$part_$id to %env. |
|
|
|
=cut |
|
|
sub upload_size_allowed { |
sub upload_size_allowed { |
my ($name,$size,$fname) = @_; |
my ($name,$size,$fname) = @_; |
if ($name =~ /^HWFILE(\w+)$/) { |
if ($name =~ /^HWFILE(\w+)$/) { |
my $ident = $1; |
my $ident = $1; |
my $item = 'HWFILESIZE'.$ident; |
my $item = 'HWFILESIZE'.$ident; |
&Apache::loncommon::add_to_env("form.$item",$size); |
my $savesize = sprintf("%.6f",$size); |
|
&Apache::loncommon::add_to_env("form.$item",$savesize); |
my $maxsize= &Apache::lonnet::EXT("resource.$ident.maxfilesize"); |
my $maxsize= &Apache::lonnet::EXT("resource.$ident.maxfilesize"); |
if (!$maxsize) { |
if (!$maxsize) { |
$maxsize = 100.0; |
$maxsize = 100.0; |
Line 244 sub upload_size_allowed {
|
Line 253 sub upload_size_allowed {
|
return 'ok'; |
return 'ok'; |
} |
} |
|
|
# handle the case of the single sign on user, at this point $r->user |
=pod |
# will be set and valid now need to find the loncapa user info and possibly |
|
# balance them |
=item sso_login() |
# returns OK if it was a SSO and user was handled |
|
# undef if not SSO or no means to hanle the user |
handle the case of the single sign on user, at this point $r->user |
|
will be set and valid now need to find the loncapa user info and possibly |
|
balance them |
|
returns OK if it was a SSO and user was handled |
|
undef if not SSO or no means to hanle the user |
|
|
|
=cut |
|
|
sub sso_login { |
sub sso_login { |
my ($r,$handle) = @_; |
my ($r,$handle) = @_; |
Line 337 sub handler {
|
Line 352 sub handler {
|
return OK; |
return OK; |
} |
} |
|
|
|
|
my $handle = &Apache::lonnet::check_for_valid_session($r); |
my $handle = &Apache::lonnet::check_for_valid_session($r); |
|
|
my $result = &sso_login($r,$handle); |
my $result = &sso_login($r,$handle); |
Line 522 sub handler {
|
Line 536 sub handler {
|
|
|
1; |
1; |
__END__ |
__END__ |
|
|
|
=pod |
|
|
|
=back |
|
|
|
=cut |
|
|