--- loncom/lond	2010/01/06 04:19:08	1.435.2.1
+++ loncom/lond	2010/02/21 02:02:51	1.437
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.435.2.1 2010/01/06 04:19:08 raeburn Exp $
+# $Id: lond,v 1.437 2010/02/21 02:02:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -59,7 +59,7 @@ my $DEBUG = 0;		       # Non zero to ena
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.435.2.1 $'; #' stupid emacs
+my $VERSION='$Revision: 1.437 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -2091,8 +2091,6 @@ sub update_resource_handler {
 	if (-e $fname) {
             # Delete preview file, if exists
             unlink("$fname.tmp");
-            # Delete GCI Test Assembly preview file, if exists
-            unlink("$fname.tn");
             # Get usage stats
 	    my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
 		$atime,$mtime,$ctime,$blksize,$blocks)=stat($fname);
@@ -3872,6 +3870,19 @@ sub dump_course_id_handler {
                             $items->{'cloners'} = $cloneruname.':'.$clonerudom;
                             $valchange = 1;
                         }
+                        unless ($canclone) {
+                            if ($items->{'owner'} =~ /:/) {
+                                if ($items->{'owner'} eq $cloner) {
+                                    $canclone = 1;
+                                }
+                            } elsif ($cloner eq $udom.':'.$items->{'owner'}) {
+                                $canclone = 1;
+                            }
+                            if ($canclone) {
+                                $items->{'cloners'} = $cloneruname.':'.$clonerudom;
+                                $valchange = 1;
+                            }
+                        }
                     }
                 }
                 if ($unpack || !$rtn_as_hash) {
@@ -6555,9 +6566,7 @@ sub rewrite_password_file {
 
 #     Returns the authorization type or nouser if there is no such user.
 #
-sub get_auth_type 
-{
-
+sub get_auth_type {
     my ($domain, $user)  = @_;
 
     Debug("get_auth_type( $domain, $user ) \n");