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

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 18 Nov 2002 20:06:53 -0000


matthew		Mon Nov 18 15:06:53 2002 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  Fixed a "bug" which allowed the user to assign co-author privileges to 
  themselves.
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.43 loncom/interface/loncreateuser.pm:1.44
--- loncom/interface/loncreateuser.pm:1.43	Thu Oct  3 10:56:48 2002
+++ loncom/interface/loncreateuser.pm	Mon Nov 18 15:06:53 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.43 2002/10/03 14:56:48 www Exp $
+# $Id: loncreateuser.pm,v 1.44 2002/11/18 20:06:53 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -47,7 +47,7 @@
 # 11/12,11/13,11/15 Scott Harrison
 # 02/11/02 Matthew Hall
 #
-# $Id: loncreateuser.pm,v 1.43 2002/10/03 14:56:48 www Exp $
+# $Id: loncreateuser.pm,v 1.44 2002/11/18 20:06:53 matthew Exp $
 ###
 
 package Apache::loncreateuser;
@@ -437,7 +437,9 @@
 #
 # Co-Author
 # 
-    if (&authorpriv($ENV{'user.name'},$ENV{'request.role.domain'})) {
+    if (&authorpriv($ENV{'user.name'},$ENV{'request.role.domain'}) &&
+        ($ENV{'user.name'} ne $ccuname || $ENV{'user.domain'} ne $ccdomain)) {
+        # No sense in assigning co-author role to yourself
 	my $cuname=$ENV{'user.name'};
         my $cudom=$ENV{'request.role.domain'};
        $r->print(<<ENDCOAUTH);