version 1.1, 2005/11/29 21:02:50
|
version 1.11, 2007/04/11 21:36:58
|
Line 36 use Apache::lonnet;
|
Line 36 use Apache::lonnet;
|
sub handler { |
sub handler { |
my ($r) = @_; |
my ($r) = @_; |
|
|
|
if (&Apache::lonnet::is_domainimage($r->uri)) { |
|
return OK; |
|
} |
|
|
|
if ($r->auth_type() ne 'LONCAPA') { |
|
return DECLINED; |
|
} |
my $fail = FORBIDDEN; |
my $fail = FORBIDDEN; |
if ($r->dir_config('lonOtherAuthen') eq 'yes') { |
if ($r->dir_config('lonOtherAuthen') eq 'yes') { |
&Apache::lonnet::logthis("other authen"); |
if (defined($r->dir_config('lonOtherAuthenType'))) { |
|
$r->auth_type($r->dir_config('lonOtherAuthenType')); |
|
} |
|
#&Apache::lonnet::logthis("other authen"); |
$fail = DECLINED; |
$fail = DECLINED; |
} |
} |
|
|
Line 53 sub handler {
|
Line 63 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; |