--- loncom/auth/lonauth.pm 2006/08/30 16:50:23 1.81 +++ loncom/auth/lonauth.pm 2006/10/06 14:29:44 1.82.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network # User Authentication Module # -# $Id: lonauth.pm,v 1.81 2006/08/30 16:50:23 albertel Exp $ +# $Id: lonauth.pm,v 1.82.2.1 2006/10/06 14:29:44 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -180,7 +180,7 @@ sub success { } &add_to_env($idf,\%initial_env); - &add_to_env($idf,\%userenv); + &add_to_env($idf,\%userenv,'environment.'); &add_to_env($idf,$userroles); &add_to_env($idf,$extra_env); close($idf); @@ -250,10 +250,10 @@ ENDSUCCESS } sub add_to_env { - my ($idf,$env_data) = @_; - @env{keys(%$env_data)} = @$env_data{keys(%$env_data)}; + my ($idf,$env_data,$prefix) = @_; while (my ($key,$value) = each(%$env_data)) { - print $idf (&escape($key).'='.&escape($value)."\n"); + print $idf (&escape($prefix.$key).'='.&escape($value)."\n"); + $env{$prefix.$key} = $value; } } @@ -344,7 +344,9 @@ ENDFAILED my $buffer; - $r->read($buffer,$r->header_in('Content-length'),0); + if ($r->header_in('Content-length') > 0) { + $r->read($buffer,$r->header_in('Content-length'),0); + } my @pairs=split(/&/,$buffer); my $pair; my $name; my $value; undef %FORM;