version 1.5, 2006/06/05 15:08:48
|
version 1.10, 2006/11/23 01:49:41
|
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; |
if ($r->dir_config('lonOtherAuthen') eq 'yes') { |
if ($r->dir_config('lonOtherAuthen') eq 'yes') { |
|
if (defined($r->dir_config('lonOtherAuthenType'))) { |
|
$r->auth_type($r->dir_config('lonOtherAuthenType')); |
|
} |
#&Apache::lonnet::logthis("other authen"); |
#&Apache::lonnet::logthis("other authen"); |
$fail = DECLINED; |
$fail = DECLINED; |
} |
} |
Line 56 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; |
$handle=&LONCAPA::clean_handle($lonid->value); |
$handle=~s/\W//g; |
$handle = $r->dir_config('lonIDsDir')."/$handle.id"; |
my $lonidsdir=$r->dir_config('lonIDsDir'); |
} else { |
if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) { |
$handle = $env{'user.environment'}; |
return OK; |
} |
} |
|
|
if (($handle ne '') && (-e $handle)) { |
|
return OK; |
} |
} |
|
|
return $fail; |
return $fail; |