version 1.6, 2006/08/30 21:35:08
|
version 1.8, 2006/09/19 15:18:54
|
Line 36 use Apache::lonnet;
|
Line 36 use Apache::lonnet;
|
sub handler { |
sub handler { |
my ($r) = @_; |
my ($r) = @_; |
|
|
if ($r->auth_type() eq 'Basic') { |
if ($r->auth_type() ne 'LONCAPA') { |
return DECLINED; |
return DECLINED; |
} |
} |
my $fail = FORBIDDEN; |
my $fail = FORBIDDEN; |
Line 59 sub handler {
|
Line 59 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 $handle; |
if ($lonid) { |
if ($lonid) { |
my $handle=$lonid->value; |
my $handle = $lonid->value; |
$handle=~s/\W//g; |
$handle=~s/\W//g; |
my $lonidsdir=$r->dir_config('lonIDsDir'); |
$handle = $r->dir_config('lonIDsDir')."/$handle.id"; |
if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) { |
} else { |
return OK; |
$handle = $env{'user.environment'}; |
} |
|
} |
} |
|
|
|
if (($handle ne '') && (-e $handle)) { |
|
return OK; |
|
} |
|
|
return $fail; |
return $fail; |
} |
} |
|
|