[LON-CAPA-cvs] cvs: loncom / lond

raeburn raeburn@source.lon-capa.org
Sun, 21 Feb 2010 02:02:52 -0000


raeburn		Sun Feb 21 02:02:52 2010 EDT

  Modified files:              
    /loncom	lond 
  Log:
  - Bug 6176. Owners of courses can clone them even if they no longer have an
    active Course Coordinator role. 
  
  
Index: loncom/lond
diff -u loncom/lond:1.436 loncom/lond:1.437
--- loncom/lond:1.436	Sun Jan 31 04:31:00 2010
+++ loncom/lond	Sun Feb 21 02:02:51 2010
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.436 2010/01/31 04:31:00 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 $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.436 $'; #' stupid emacs
+my $VERSION='$Revision: 1.437 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -3870,6 +3870,19 @@
                             $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) {