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

www lon-capa-cvs-allow@mail.lon-capa.org
Wed, 23 Jan 2008 00:37:35 -0000


www		Tue Jan 22 19:37:35 2008 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  Bug #4646: do not clone usernames from earlier courses
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.637 loncom/interface/loncommon.pm:1.638
--- loncom/interface/loncommon.pm:1.637	Tue Jan 22 17:37:18 2008
+++ loncom/interface/loncommon.pm	Tue Jan 22 19:37:34 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.637 2008/01/22 22:37:18 www Exp $
+# $Id: loncommon.pm,v 1.638 2008/01/23 00:37:34 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -8088,14 +8088,21 @@
 	$cenv{'url'}=$oldcenv{'url'};
 # Restore title
 	$cenv{'description'}=$oldcenv{'description'};
-# restore grading mode
-	if (defined($oldcenv{'grading'})) {
-	    $cenv{'grading'}=$oldcenv{'grading'};
-	}
 # Mark as cloned
 	$cenv{'clonedfrom'}=$cloneid;
-	delete($cenv{'default_enrollment_start_date'});
-	delete($cenv{'default_enrollment_end_date'});
+# Need to clone grading mode
+        my %newenv=&Apache::lonnet::get('environment',['grading'],$$crsudom,$$crsunum);
+        $cenv{'grading'}=$newenv{'grading'};
+# Do not clone these environment entries
+        &Apache::lonnet::del('environment',
+                  ['default_enrollment_start_date',
+                   'default_enrollment_end_date',
+                   'question.email',
+                   'policy.email',
+                   'comment.email',
+                   'pch.users.denied',
+                   'plc.users.denied'],
+                   $$crsudom,$$crsunum);
     }
 
 #
@@ -8123,7 +8130,6 @@
     } else {
         $cenv{'internal.courseowner'} = $args->{'curruser'};
     }
-
     my @badclasses = (); # Used to accumulate sections/crosslistings that did not pass classlist access check for course owner.
     if ($args->{'crssections'}) {
         $cenv{'internal.sectionnums'} = '';