version 1.121, 2008/11/25 14:19:07
|
version 1.128, 2009/09/25 13:51:44
|
Line 238 sub upload_size_allowed {
|
Line 238 sub upload_size_allowed {
|
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 = 10.0; # FIXME This should become a domain configuration. |
} |
} |
if ($size > $maxsize) { |
if ($size > $maxsize) { |
my $warn = 'HWFILETOOBIG'.$ident; |
my $warn = 'HWFILETOOBIG'.$ident; |
Line 277 sub sso_login {
|
Line 278 sub sso_login {
|
|
|
my ($user) = ($r->user =~ m/([a-zA-Z0-9_\-@.]*)/); |
my ($user) = ($r->user =~ m/([a-zA-Z0-9_\-@.]*)/); |
|
|
|
my $query = $r->args; |
|
my %form; |
|
if ($query) { |
|
my @items = ('role','symb'); |
|
&Apache::loncommon::get_unprocessed_cgi($query,\@items); |
|
foreach my $item (@items) { |
|
if (defined($env{'form.'.$item})) { |
|
$form{$item} = $env{'form.'.$item}; |
|
} |
|
} |
|
} |
|
|
my $domain = $r->dir_config('lonDefDomain'); |
my $domain = $r->dir_config('lonDefDomain'); |
my $home=&Apache::lonnet::homeserver($user,$domain); |
my $home=&Apache::lonnet::homeserver($user,$domain); |
if ($home !~ /(con_lost|no_host|no_such_host)/) { |
if ($home !~ /(con_lost|no_host|no_such_host)/) { |
Line 301 sub sso_login {
|
Line 314 sub sso_login {
|
'server' => $r->dir_config('lonHostID'), |
'server' => $r->dir_config('lonHostID'), |
'sso.login' => 1 |
'sso.login' => 1 |
); |
); |
|
foreach my $item ('role','symb') { |
|
if (exists($form{$item})) { |
|
$info{$item} = $form{$item}; |
|
} |
|
} |
if ($r->dir_config("ssodirecturl") == 1) { |
if ($r->dir_config("ssodirecturl") == 1) { |
$info{'origurl'} = $r->uri; |
$info{'origurl'} = $r->uri; |
} |
} |
Line 351 sub handler {
|
Line 369 sub handler {
|
return OK; |
return OK; |
} |
} |
|
|
|
if ($requrl =~ m{^/res/adm/pages/[^/]+\.(gif|png)$}) { |
|
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 436 sub handler {
|
Line 457 sub handler {
|
$env{'user.domain'} eq 'public' && |
$env{'user.domain'} eq 'public' && |
$requrl !~ m{^/+(res|public|uploaded)/} && |
$requrl !~ m{^/+(res|public|uploaded)/} && |
$requrl !~ m{^/adm/[^/]+/[^/]+/aboutme/portfolio$ }x && |
$requrl !~ m{^/adm/[^/]+/[^/]+/aboutme/portfolio$ }x && |
|
$requrl !~ m{^/adm/blockingstatus/.*$} && |
$requrl !~ m{^/+adm/(help|logout|restrictedaccess|randomlabel\.png)}) { |
$requrl !~ m{^/+adm/(help|logout|restrictedaccess|randomlabel\.png)}) { |
$env{'request.querystring'}=$r->args; |
$env{'request.querystring'}=$r->args; |
$env{'request.firsturl'}=$requrl; |
$env{'request.firsturl'}=$requrl; |
Line 445 sub handler {
|
Line 467 sub handler {
|
if ($env{'request.course.id'}) { |
if ($env{'request.course.id'}) { |
&Apache::lonnet::countacc($requrl); |
&Apache::lonnet::countacc($requrl); |
$requrl=~/\.(\w+)$/; |
$requrl=~/\.(\w+)$/; |
|
my $query=$r->args; |
if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') || |
if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') || |
($requrl=~/^\/adm\/.*\/(aboutme|navmaps|smppg|bulletinboard)(\?|$ )/x) || |
($requrl=~/^\/adm\/.*\/(aboutme|navmaps|smppg|bulletinboard)(\?|$ )/x) || |
($requrl=~/^\/adm\/wrapper\//) || |
($requrl=~/^\/adm\/wrapper\//) || |
Line 452 sub handler {
|
Line 475 sub handler {
|
($requrl=~m|\.problem/smpedit$|) || |
($requrl=~m|\.problem/smpedit$|) || |
($requrl=~/^\/public\/.*\/syllabus$/)) { |
($requrl=~/^\/public\/.*\/syllabus$/)) { |
# ------------------------------------- This is serious stuff, get symb and log |
# ------------------------------------- This is serious stuff, get symb and log |
my $query=$r->args; |
|
my $symb; |
my $symb; |
if ($query) { |
if ($query) { |
&Apache::loncommon::get_unprocessed_cgi($query,['symb']); |
&Apache::loncommon::get_unprocessed_cgi($query,['symb']); |
Line 499 sub handler {
|
Line 521 sub handler {
|
# ------------------------------------------------------- This is other content |
# ------------------------------------------------------- This is other content |
&Apache::lonnet::courseacclog($requrl); |
&Apache::lonnet::courseacclog($requrl); |
} |
} |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};; |
|
if ($requrl =~ m{^/+uploaded/\Q$cdom\E/\Q$cnum\E/docs/.+\.html?$}) { |
|
if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) { |
|
if ($query) { |
|
&Apache::loncommon::get_unprocessed_cgi($query,['forceedit']); |
|
if ($env{'form.forceedit'}) { |
|
$env{'request.state'} = 'edit'; |
|
} |
|
} |
|
} |
|
} |
} |
} |
return OK; |
return OK; |
} |
} |