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

raeburn raeburn at source.lon-capa.org
Mon Jul 13 23:03:52 EDT 2015


raeburn		Tue Jul 14 03:03:52 2015 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	loncommon.pm 
  Log:
  - For 2.11
    Backport 1.1225.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.95 loncom/interface/loncommon.pm:1.1075.2.96
--- loncom/interface/loncommon.pm:1.1075.2.95	Fri May 22 17:33:11 2015
+++ loncom/interface/loncommon.pm	Tue Jul 14 03:03:51 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1075.2.95 2015/05/22 17:33:11 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.96 2015/07/14 03:03:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -14129,9 +14129,12 @@
                     $can_clone = 1;
                 } elsif (grep(/^\*\:\Q$args->{'ccdomain'}\E$/, at cloners)) {
                     $can_clone = 1;
+                } elsif (grep(/^\Q$args->{'ccuname'}\E:\Q$args->{'ccdomain'}\E$/, at cloners)) {
+                    $can_clone = 1;
                 }
                 unless ($can_clone) {
-                    if (($clonehash{'internal.coursecode'}) && ($args->{'crscode'}) && ($args->{'clonedomain'} eq  $args->{'course_domain'})) {
+                    if (($clonehash{'internal.coursecode'}) && ($args->{'crscode'}) &&
+                        ($args->{'clonedomain'} eq  $args->{'course_domain'})) {
                         my (%gotdomdefaults,%gotcodedefaults);
                         foreach my $cloner (@cloners) {
                             if (($cloner ne '*') && ($cloner !~ /^\*\:$match_domain$/) &&
@@ -14162,24 +14165,23 @@
                             }
                         }
                     }
-                    unless ($can_clone) {
-                        my $ccrole = 'cc';
-                        if ($args->{'crstype'} eq 'Community') {
-                            $ccrole = 'co';
-                        }
-                        my %roleshash =
-                            &Apache::lonnet::get_my_roles($args->{'ccuname'},
-                                                          $args->{'ccdomain'},
-                                                          'userroles',['active'],[$ccrole],
-                                                          [$args->{'clonedomain'}]);
-                        if (($roleshash{$args->{'clonecourse'}.':'.$args->{'clonedomain'}.':'.$ccrole}) ||
-                            (grep(/^\Q$args->{'ccuname'}\E:\Q$args->{'ccdomain'}\E$/, at cloners))) {
-                            $can_clone = 1;
-                        } elsif (&Apache::lonnet::is_course_owner($args->{'clonedomain'},$args->{'clonecourse'},
-                                                                  $args->{'ccuname'},$args->{'ccdomain'})) {
-                            $can_clone = 1;
-                        }
-                    }
+                }
+            }
+            unless ($can_clone) {
+                my $ccrole = 'cc';
+                if ($args->{'crstype'} eq 'Community') {
+                    $ccrole = 'co';
+                }
+                my %roleshash =
+                    &Apache::lonnet::get_my_roles($args->{'ccuname'},
+                                                  $args->{'ccdomain'},
+                                                  'userroles',['active'],[$ccrole],
+                                                  [$args->{'clonedomain'}]);
+                if ($roleshash{$args->{'clonecourse'}.':'.$args->{'clonedomain'}.':'.$ccrole}) {
+                    $can_clone = 1;
+                } elsif (&Apache::lonnet::is_course_owner($args->{'clonedomain'},$args->{'clonecourse'},
+                                                          $args->{'ccuname'},$args->{'ccdomain'})) {
+                    $can_clone = 1;
                 }
             }
             unless ($can_clone) {




More information about the LON-CAPA-cvs mailing list