[LON-CAPA-cvs] cvs: loncom /auth lonauth.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 30 Aug 2006 22:12:12 -0000


albertel		Wed Aug 30 18:12:12 2006 EDT

  Modified files:              
    /loncom/auth	lonauth.pm 
  Log:
  - user environment gets it's keys prefixed
  
  
  
Index: loncom/auth/lonauth.pm
diff -u loncom/auth/lonauth.pm:1.81 loncom/auth/lonauth.pm:1.82
--- loncom/auth/lonauth.pm:1.81	Wed Aug 30 12:50:23 2006
+++ loncom/auth/lonauth.pm	Wed Aug 30 18:12:11 2006
@@ -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 2006/08/30 22:12:11 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -180,7 +180,7 @@
 	}
 
 	&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 @@
 }
 
 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;
     }
 }