version 1.3, 2004/11/09 21:16:31
|
version 1.6, 2004/11/14 07:54:41
|
Line 44 sub handler {
|
Line 44 sub handler {
|
my $handle=$lonid->value; |
my $handle=$lonid->value; |
$handle=~s/\W//g; |
$handle=~s/\W//g; |
my $lonidsdir=$r->dir_config('lonIDsDir'); |
my $lonidsdir=$r->dir_config('lonIDsDir'); |
|
$ENV{'request.enc'}=1; |
if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) { |
if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) { |
# Initialize Environment |
# Initialize Environment |
&Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle); |
&Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle); |
# Decrypt URL and redirect |
# Decrypt URL and redirect |
$r->internal_redirect(&unencrypted($r->uri)); |
&Apache::lonnet::logthis("args ".$r->args); |
|
&Apache::lonnet::logthis("uri ".$r->uri); |
|
$r->internal_redirect(&unencrypted($r->uri).'?'.$r->args); |
return OK; |
return OK; |
} |
} |
} |
} |
Line 79 sub unencrypted {
|
Line 82 sub unencrypted {
|
pack("H16",substr($uri,$encidx,16)) |
pack("H16",substr($uri,$encidx,16)) |
); |
); |
} |
} |
|
$ENV{'request.enc'}=1; |
return substr($decuri,0,$cmdlength); |
return substr($decuri,0,$cmdlength); |
} |
} |
|
|
Line 100 sub encrypted {
|
Line 104 sub encrypted {
|
return '/enc/'.$cmdlength.'/'.&Apache::lonnet::escape($encuri); |
return '/enc/'.$cmdlength.'/'.&Apache::lonnet::escape($encuri); |
} |
} |
|
|
|
sub check_encrypt { |
|
my $str=shift; |
|
if ($ENV{'request.enc'}) { return &Apache::lonenc::encrypted($str); } |
|
return $str; |
|
} |
|
|
|
sub check_decrypt { |
|
my ($str)=@_; |
|
if ($$str=~m|^/enc/|) { $$str=&Apache::lonenc::unencrypted($$str); } |
|
} |
|
|
1; |
1; |
__END__ |
__END__ |
|
|