version 1.17, 2007/09/29 04:03:46
|
version 1.19, 2007/11/14 02:55:07
|
Line 42 sub init_env {
|
Line 42 sub init_env {
|
return $env{'user.environment'}; |
return $env{'user.environment'}; |
} |
} |
my $requrl=$r->uri; |
my $requrl=$r->uri; |
my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); |
my $handle= &Apache::lonnet::check_for_valid_session($r); |
my $lonid=$cookies{'lonID'}; |
if ($handle ne '') { |
my $cookie; |
|
if (!$lonid) { return undef; } |
|
|
|
my $handle=&LONCAPA::clean_handle($lonid->value); |
|
my $lonidsdir=$r->dir_config('lonIDsDir'); |
|
if ((!-e "$lonidsdir/$handle.id") || ($handle eq '')) { |
|
$r->log_reason("Cookie $handle not valid", $r->filename); |
|
return undef; |
return undef; |
} |
} |
|
my $lonidsdir=$r->dir_config('lonIDsDir'); |
&Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle); |
&Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle); |
|
|
return $r->dir_config('lonIDsDir')."/$handle.id"; |
return $r->dir_config('lonIDsDir')."/$handle.id"; |
Line 99 sub handler {
|
Line 92 sub handler {
|
|
|
if ($env{'user.name'} eq 'public' |
if ($env{'user.name'} eq 'public' |
&& $env{'user.domain'} eq 'public') { |
&& $env{'user.domain'} eq 'public') { |
my $url = 'http://'.$switch_to.'/'.$r->uri; |
my $url = 'http://'.$switch_to.$r->uri; |
return &do_redirect($r,$url,1) |
return &do_redirect($r,$url,1) |
} |
} |
|
|