[LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Wed Aug 31 22:47:57 EDT 2011


raeburn		Thu Sep  1 02:47:57 2011 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Bug 6505.
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.356 loncom/interface/loncreateuser.pm:1.357
--- loncom/interface/loncreateuser.pm:1.356	Thu Sep  1 02:32:50 2011
+++ loncom/interface/loncreateuser.pm	Thu Sep  1 02:47:51 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.356 2011/09/01 02:32:50 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.357 2011/09/01 02:47:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1322,7 +1322,7 @@
             $addrolesdisplay = &new_coauthor_roles($r,$ccuname,$ccdomain);
         }
         if ($context eq 'domain') {
-            my $add_domainroles = &new_domain_roles($r);
+            my $add_domainroles = &new_domain_roles($r,$ccdomain);
             if (!$addrolesdisplay) {
                 $addrolesdisplay = $add_domainroles;
             }
@@ -1765,7 +1765,7 @@
 }
 
 sub new_domain_roles {
-    my ($r) = @_;
+    my ($r,$ccdomain) = @_;
     my $addrolesdisplay = 0;
     #
     # Domain level
@@ -1783,6 +1783,7 @@
     foreach my $thisdomain (sort(&Apache::lonnet::all_domains())) {
         foreach my $role (@allroles) {
             next if ($role eq 'ad');
+            next if (($role eq 'au') && ($ccdomain ne $thisdomain));
             if (&Apache::lonnet::allowed('c'.$role,$thisdomain)) {
                my $plrole=&Apache::lonnet::plaintext($role);
                my %lt=&Apache::lonlocal::texthash(
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1130 loncom/lonnet/perl/lonnet.pm:1.1131
--- loncom/lonnet/perl/lonnet.pm:1.1130	Wed Aug 17 00:32:27 2011
+++ loncom/lonnet/perl/lonnet.pm	Thu Sep  1 02:47:57 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1130 2011/08/17 00:32:27 raeburn Exp $
+# $Id: lonnet.pm,v 1.1131 2011/09/01 02:47:57 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7075,6 +7075,13 @@
                     return 'refused';
                 }
             }
+        } elsif ($role eq 'au') {
+            if ($url ne '/'.$udom.'/') {
+                &logthis('Attempt by '.$env{'user.name'}.':'.$env{'user.domain'}.
+                         ' to assign author role for '.$uname.':'.$udom.
+                         ' in domain: '.$url.' refused (wrong domain).');
+                return 'refused';
+            }
         }
         $mrole=$role;
     }




More information about the LON-CAPA-cvs mailing list