[LON-CAPA-cvs] cvs: loncom /enrollment Enrollment.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Fri, 03 Aug 2007 22:02:03 -0000


albertel		Fri Aug  3 18:02:03 2007 EDT

  Modified files:              
    /loncom/enrollment	Enrollment.pm 
  Log:
  - trying to disabiguate the double use of the variable $context, think I got it right
  
  
Index: loncom/enrollment/Enrollment.pm
diff -u loncom/enrollment/Enrollment.pm:1.35 loncom/enrollment/Enrollment.pm:1.36
--- loncom/enrollment/Enrollment.pm:1.35	Sun Jul  1 23:37:19 2007
+++ loncom/enrollment/Enrollment.pm	Fri Aug  3 18:02:01 2007
@@ -1,5 +1,5 @@
 # Automated Enrollment manager
-# $Id: Enrollment.pm,v 1.35 2007/07/02 03:37:19 raeburn Exp $
+# $Id: Enrollment.pm,v 1.36 2007/08/03 22:02:01 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -454,7 +454,8 @@
 }
 
 sub create_newuser {
-    my ($args,$logmsg,$newusermsg,$enrollcount,$addresult,$longroles,$courseinfo,$context) = @_;
+    my ($args,$logmsg,$newusermsg,$enrollcount,$addresult,$longroles,
+	$courseinfo,$called_context) = @_;
     my $auth = $args->{'auth'};
     my $authparam = $args->{'authparam'};
     my $emailenc = $args->{'emailenc'};
@@ -511,7 +512,7 @@
         if ($context eq 'createowner' || $context eq 'createcourse') {
             my $result = &Apache::lonnet::modifyuser($udom,$uname,$pid,$auth,$authparam,$first,$middle,$last,$gene,'1',undef,$emailaddr);
             if ($result eq 'ok' && $context eq 'createcourse') {
-                $outcome = &Apache::loncommon::commit_standardrole($udom,$uname,$userurl,$role,$start,$end,$cdom,$crs,$usec,$context);
+                $outcome = &Apache::loncommon::commit_standardrole($udom,$uname,$userurl,$role,$start,$end,$cdom,$crs,$usec,$called_context);
                 unless ($outcome =~ /^Error:/) {
                     $outcome = 'ok';
                 }
@@ -531,7 +532,7 @@
             unless ($context eq 'createowner' || $context eq 'createcourse') {
                 $$enrollcount ++;
             }
-            if ($context eq 'automated') {
+            if ($called_context eq 'automated') {
                 $$logmsg .= &mt('New [_1] user [_2] added successfully.',$udom,$uname);
             }
             unless ($emailenc eq '' || $context eq 'createowner' || $context eq 'createcourse') {
@@ -563,11 +564,11 @@
                     }
                     &Apache::lonmsg::sendemail($emailaddr,$subject,$body);
                 }
-                if ($context eq 'automated') {
+                if ($called_context eq 'automated') {
                     $$logmsg .= &mt(' Initial password - sent to ').$emailaddr.$linefeed;
                 }
             } else {
-                if ($context eq 'automated') {
+                if ($called_context eq 'automated') {
                     $$logmsg .= $linefeed;
                 }
             }