version 1.4, 2006/06/05 10:03:11
|
version 1.13, 2012/04/18 18:55:06
|
Line 36 use Apache::lonnet;
|
Line 36 use Apache::lonnet;
|
sub handler { |
sub handler { |
my ($r) = @_; |
my ($r) = @_; |
|
|
if ($r->auth_type() ne 'Basic') { |
if (&Apache::lonnet::is_domainimage($r->uri)) { |
|
return OK; |
|
} |
|
|
|
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 54 sub handler {
|
Line 61 sub handler {
|
} |
} |
} |
} |
|
|
my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); |
my $handle = &Apache::lonnet::check_for_valid_session($r); |
my $lonid=$cookies{'lonID'}; |
if ($handle eq '') { |
my $cookie; |
$handle = $env{'user.environment'}; |
if ($lonid) { |
|
my $handle=$lonid->value; |
|
$handle=~s/\W//g; |
|
my $lonidsdir=$r->dir_config('lonIDsDir'); |
|
if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) { |
|
return OK; |
|
} |
|
} |
} |
|
|
|
if ($handle ne '') { |
|
return OK; |
|
} |
|
if (($fail == FORBIDDEN) && ($r->uri eq '/adm/email')) { |
|
$env{'form.firsturl'} = $r->uri; |
|
} |
return $fail; |
return $fail; |
} |
} |
|
|