[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 01 Dec 2005 23:04:10 -0000


albertel		Thu Dec  1 18:04:10 2005 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - shidt settings memeory from being course wide to beign user and course specific
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.299 loncom/interface/loncommon.pm:1.300
--- loncom/interface/loncommon.pm:1.299	Tue Nov 22 17:33:01 2005
+++ loncom/interface/loncommon.pm	Thu Dec  1 18:04:08 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.299 2005/11/22 22:33:01 foxr Exp $
+# $Id: loncommon.pm,v 1.300 2005/12/01 23:04:08 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4355,13 +4355,14 @@
     # save to the environment
     # appenv the same items, just to be safe
     my $courseid = $env{'request.course.id'};
-    my $coursedom = $env{'course.'.$courseid.'.domain'};
+    my $udom  = $env{'user.domain'};
+    my $uname = $env{'user.name'};
     my ($prefix,$Settings) = @_;
     my %SaveHash;
     my %AppHash;
     while (my ($setting,$type) = each(%$Settings)) {
-        my $basename = 'internal.'.$prefix.'.'.$setting;
-        my $envname = 'course.'.$courseid.'.'.$basename;
+        my $basename = join('.','internal',$courseid,$prefix,$setting);
+        my $envname = 'environment.'.$basename;
         if (exists($env{'form.'.$setting})) {
             # Save this value away
             if ($type eq 'scalar' &&
@@ -4389,8 +4390,7 @@
         }
     }
     my $put_result = &Apache::lonnet::put('environment',\%SaveHash,
-                                          $coursedom,
-                                          $env{'course.'.$courseid.'.num'});
+                                          $udom,$uname);
     if ($put_result !~ /^(ok|delayed)/) {
         &Apache::lonnet::logthis('unable to save form parameters, '.
                                  'got error:'.$put_result);
@@ -4405,7 +4405,7 @@
     my ($prefix,$Settings) = @_;
     while (my ($setting,$type) = each(%$Settings)) {
         next if (exists($env{'form.'.$setting}));
-        my $envname = 'course.'.$courseid.'.internal.'.$prefix.
+        my $envname = 'environment.internal.'.$courseid.'.'.$prefix.
             '.'.$setting;
         if (exists($env{$envname})) {
             if ($type eq 'scalar') {