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

raeburn raeburn@source.lon-capa.org
Fri, 14 Aug 2009 08:37:54 -0000


raeburn		Fri Aug 14 08:37:54 2009 EDT

  Modified files:              (Branch: version_2_9_X)
    /loncom/interface	loncommon.pm 
  Log:
  - Backport 1.882.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.692.4.11 loncom/interface/loncommon.pm:1.692.4.12
--- loncom/interface/loncommon.pm:1.692.4.11	Fri Aug 14 08:32:17 2009
+++ loncom/interface/loncommon.pm	Fri Aug 14 08:37:53 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.692.4.11 2009/08/14 08:32:17 raeburn Exp $
+# $Id: loncommon.pm,v 1.692.4.12 2009/08/14 08:37:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -9286,8 +9286,9 @@
         $clonemsg = &mt('No new course created.').$linefeed.&mt('A new course could not be cloned from the specified original - [_1] - because it is a non-existent course.',$args->{'clonecourse'}.':'.$args->{'clonedomain'});     
     } else {
 	my %clonedesc = &Apache::lonnet::coursedescription($cloneid,{'one_time' => 1});
-	if ($env{'request.role.domain'} eq $args->{'clonedomain'}) {
-	    $can_clone = 1;
+        if (($env{'request.role.domain'} eq $args->{'clonedomain'}) && 
+            (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'}))) {
+ 	    $can_clone = 1;
 	} else {
 	    my %clonehash = &Apache::lonnet::get('environment',['cloners'],
 						 $args->{'clonedomain'},$args->{'clonecourse'});
@@ -9314,7 +9315,7 @@
 }
 
 sub construct_course {
-    my ($args,$logmsg,$courseid,$crsudom,$crsunum,$udom,$uname,$context) = @_;
+    my ($args,$logmsg,$courseid,$crsudom,$crsunum,$udom,$uname,$context,$cnum) = @_;
     my $outcome;
     my $linefeed =  '<br />'."\n";
     if ($context eq 'auto') {
@@ -9352,7 +9353,9 @@
                                              $args->{'crscode'},
                                              $args->{'ccuname'}.':'.
                                              $args->{'ccdomain'},
-                                             $args->{'crstype'});
+                                             $args->{'crstype'},
+                                             $cnum);
+
 
     # Note: The testing routines depend on this being output; see 
     # Utils::Course. This needs to at least be output as a comment