version 1.125, 2009/04/14 23:52:07
|
version 1.130.6.1, 2011/11/18 22:41:02
|
Line 278 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 302 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 394 sub handler {
|
Line 411 sub handler {
|
} |
} |
$env{'request.filename'} = $r->filename; |
$env{'request.filename'} = $r->filename; |
$env{'request.noversionuri'} = &Apache::lonnet::deversion($requrl); |
$env{'request.noversionuri'} = &Apache::lonnet::deversion($requrl); |
|
if ($requrl =~ m{^/adm/wrapper/ext/}) { |
|
my $query = $r->args; |
|
if ($query) { |
|
my $preserved; |
|
foreach my $pair (split(/&/,$query)) { |
|
my ($name, $value) = split(/=/,$pair); |
|
unless (($name eq 'symb') || ($name eq 'wrapperdisplay')) { |
|
$preserved .= $pair.'&'; |
|
} |
|
} |
|
$preserved =~ s/\&$//; |
|
if ($preserved) { |
|
$env{'request.external.querystring'} = $preserved; |
|
} |
|
} |
|
} |
# -------------------------------------------------------- Load POST parameters |
# -------------------------------------------------------- Load POST parameters |
|
|
&Apache::lonacc::get_posted_cgi($r); |
&Apache::lonacc::get_posted_cgi($r); |
Line 416 sub handler {
|
Line 449 sub handler {
|
return OK; |
return OK; |
} |
} |
if (($access ne '2') && ($access ne 'F')) { |
if (($access ne '2') && ($access ne 'F')) { |
$env{'user.error.msg'}="$requrl:bre:1:1:Access Denied"; |
if ($requrl =~ m{^/res/}) { |
return HTTP_NOT_ACCEPTABLE; |
$access = &Apache::lonnet::allowed('bro',$requrl); |
|
if ($access ne 'F') { |
|
$env{'user.error.msg'}="$requrl:bre:1:1:Access Denied"; |
|
return HTTP_NOT_ACCEPTABLE; |
|
} |
|
} else { |
|
$env{'user.error.msg'}="$requrl:bre:1:1:Access Denied"; |
|
return HTTP_NOT_ACCEPTABLE; |
|
} |
} |
} |
} |
} |
if ($requrl =~ m|^/prtspool/|) { |
if ($requrl =~ m|^/prtspool/|) { |
Line 440 sub handler {
|
Line 481 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 447 sub handler {
|
Line 489 sub handler {
|
} |
} |
# ------------------------------------------------------------- This is allowed |
# ------------------------------------------------------------- This is allowed |
if ($env{'request.course.id'}) { |
if ($env{'request.course.id'}) { |
&Apache::lonnet::countacc($requrl); |
my $skiplogging; |
|
if ((!&Apache::loncommon::needs_gci_custom()) && |
|
($env{'course.'.$env{'request.course.id'}.'.internal.courseowner'} ne $env{'user.name'}.':'.$env{'user.domain'})) { |
|
$skiplogging = 1; |
|
} |
|
unless ($skiplogging) { |
|
&Apache::lonnet::countacc($requrl); |
|
} |
$requrl=~/\.(\w+)$/; |
$requrl=~/\.(\w+)$/; |
my $query=$r->args; |
my $query=$r->args; |
if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') || |
if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') || |
Line 498 sub handler {
|
Line 547 sub handler {
|
} |
} |
} |
} |
$env{'request.symb'}=$symb; |
$env{'request.symb'}=$symb; |
&Apache::lonnet::courseacclog($symb); |
unless ($skiplogging) { |
|
&Apache::lonnet::courseacclog($symb); |
|
} |
} else { |
} else { |
# ------------------------------------------------------- This is other content |
# ------------------------------------------------------- This is other content |
&Apache::lonnet::courseacclog($requrl); |
unless ($skiplogging) { |
|
&Apache::lonnet::courseacclog($requrl); |
|
} |
} |
} |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};; |