version 1.68, 2005/07/07 21:38:35
|
version 1.70, 2005/11/29 21:12:03
|
Line 44 sub handler {
|
Line 44 sub handler {
|
my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); |
my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); |
my $lonid=$cookies{'lonID'}; |
my $lonid=$cookies{'lonID'}; |
my $cookie; |
my $cookie; |
|
my $lonidsdir=$r->dir_config('lonIDsDir'); |
|
|
|
my $handle; |
if ($lonid) { |
if ($lonid) { |
my $handle=$lonid->value; |
$handle=$lonid->value; |
$handle=~s/\W//g; |
$handle=~s/\W//g; |
my $lonidsdir=$r->dir_config('lonIDsDir'); |
} |
|
|
|
if ($r->user |
|
&& (!$lonid || !-e "$lonidsdir/$handle.id" || $handle eq '') ) { |
|
my $domain = $r->dir_config('lonDefDomain'); |
|
my $home=&Apache::lonnet::homeserver($r->user,$domain); |
|
if ($home !~ /(con_lost|no_such_host)/) { |
|
$handle=&Apache::lonauth::success($r,$r->user,$domain, |
|
$home,'noredirect'); |
|
$r->header_out('Set-cookie',"lonID=$handle; path=/"); |
|
} |
|
} |
|
|
|
if ($r->dir_config("lonBalancer") eq 'yes') { |
|
$r->set_handlers('PerlResponseHandler'=> |
|
[\&Apache::switchserver::handler]); |
|
} |
|
|
|
if ($handle ne '') { |
if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) { |
if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) { |
|
|
# ------------------------------------------------------ Initialize Environment |
# ------------------------------------------------------ Initialize Environment |
Line 95 sub handler {
|
Line 116 sub handler {
|
if ($env{'user.name'} eq 'public' && |
if ($env{'user.name'} eq 'public' && |
$env{'user.domain'} eq 'public' && |
$env{'user.domain'} eq 'public' && |
$requrl !~ m{^/+(res|public)/} && |
$requrl !~ m{^/+(res|public)/} && |
$requrl !~ m{^/+adm/(help|roles|logout|randomlabel\.png)}) { |
$requrl !~ m{^/+adm/(help|logout|randomlabel\.png)}) { |
$env{'request.querystring'}=$r->args; |
$env{'request.querystring'}=$r->args; |
$env{'request.firsturl'}=$requrl; |
$env{'request.firsturl'}=$requrl; |
return FORBIDDEN; |
return FORBIDDEN; |