version 1.10, 2006/08/04 21:31:53
|
version 1.20, 2013/02/05 21:32:45
|
Line 34 use Apache::Constants qw(:common :http :
|
Line 34 use Apache::Constants qw(:common :http :
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use CGI::Cookie(); |
|
use Fcntl qw(:flock); |
use Fcntl qw(:flock); |
use Apache::lonacc(); |
use Apache::lonacc(); |
|
use LONCAPA(); |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
|
|
my $requrl=$r->uri; |
my $requrl=$r->uri; |
my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); |
|
my $lonid=$cookies{'lonID'}; |
if (&Apache::lonnet::is_domainimage($requrl)) { |
if ($lonid) { |
if ($r->user() eq '') { |
my $handle=$lonid->value; |
$r->user('public'); |
$handle=~s/\W//g; |
} |
|
return OK; |
|
} |
|
|
|
if ($requrl =~ m{^/res/adm/pages/[^/]+\.(gif|png)$}) { |
|
if ($r->user() eq '') { |
|
$r->user('public'); |
|
} |
|
return OK; |
|
} |
|
|
|
my $handle = &Apache::lonnet::check_for_valid_session($r); |
|
if ($handle ne '') { |
my $lonidsdir=$r->dir_config('lonIDsDir'); |
my $lonidsdir=$r->dir_config('lonIDsDir'); |
if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) { |
&Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle); |
&Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle); |
if ($env{'user.name'} ne 'public' |
if ($env{'user.name'} ne 'public' |
&& $env{'user.domain'} ne 'public') { |
&& $env{'user.domain'} ne 'public') { |
return OK; |
return OK; |
|
} |
|
} |
} |
} |
} |
if ($requrl=~m|^/public/| |
if ($requrl=~m|^/public/| |
|| $requrl=~m|^/adm/help/.*\.hlp$| |
|| $requrl=~m|^/adm/help/.*\.hlp$| |
|| $requrl=~m|^/adm/[^/]+/[^/]+/aboutme/portfolio$| |
|| $requrl=~m|^/adm/[^/]+/[^/]+/aboutme/portfolio$| |
|| (&Apache::lonnet::metadata($requrl,'copyright') eq 'public')) { |
|| (&Apache::lonnet::metadata($requrl,'copyright') eq 'public') |
|
|| $requrl=~m|^/adm/blockingstatus/.*$|) { |
&process_public($r,$requrl); |
&process_public($r,$requrl); |
return OK; |
return OK; |
} elsif (&Apache::lonnet::is_portfolio_url($requrl)) { |
} elsif (&Apache::lonnet::is_portfolio_url($requrl)) { |
Line 73 sub handler {
|
Line 84 sub handler {
|
} elsif ($requrl eq '/adm/restrictedaccess') { |
} elsif ($requrl eq '/adm/restrictedaccess') { |
&process_public($r,$requrl); |
&process_public($r,$requrl); |
return OK; |
return OK; |
} |
} elsif ($requrl eq '/adm/blockedaccess') { |
|
&process_public($r,$requrl); |
|
return OK; |
|
} |
return DECLINED; |
return DECLINED; |
} |
} |
|
|