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

www lon-capa-cvs@mail.lon-capa.org
Thu, 19 Jun 2003 21:46:39 -0000


www		Thu Jun 19 17:46:39 2003 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  Part of Bug #1536: Starting and ending dates were not set correctly
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.54 loncom/interface/loncreateuser.pm:1.55
--- loncom/interface/loncreateuser.pm:1.54	Wed Jun  4 15:48:19 2003
+++ loncom/interface/loncreateuser.pm	Thu Jun 19 17:46:38 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.54 2003/06/04 19:48:19 bowersj2 Exp $
+# $Id: loncreateuser.pm,v 1.55 2003/06/19 21:46:38 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -46,7 +46,7 @@
 # 05/10,10/16 Gerd Kortemeyer 
 # 02/11/02 Matthew Hall
 #
-# $Id: loncreateuser.pm,v 1.54 2003/06/04 19:48:19 bowersj2 Exp $
+# $Id: loncreateuser.pm,v 1.55 2003/06/19 21:46:38 www Exp $
 ###
 
 package Apache::loncreateuser;
@@ -762,18 +762,21 @@
 	    if ($_=~/^form\.act\_([^\_]+)\_([^\_]+)\_([^\_]+)$/) {
 		# Activate roles for sections with 3 id numbers
 		# set start, end times, and the url for the class
-		my $start = ( $ENV{'form.start_'.$1.'_'.$2} ? 
-			      $ENV{'form.start_'.$1.'_'.$2} : 
+
+		my $start = ( $ENV{'form.start_'.$1.'_'.$2.'_'.$3} ? 
+			      $ENV{'form.start_'.$1.'_'.$2.'_'.$3} : 
 			      $now );
-		my $end   = ( $ENV{'form.end_'.$1.'_'.$2} ? 
-			      $ENV{'form.end_'.$1.'_'.$2} :
+		my $end   = ( $ENV{'form.end_'.$1.'_'.$2.'_'.$3} ? 
+			      $ENV{'form.end_'.$1.'_'.$2.'_'.$3} :
 			      0 );
 		my $url='/'.$1.'/'.$2;
 		if ($ENV{'form.sec_'.$1.'_'.$2.'_'.$3}) {
 		    $url.='/'.$ENV{'form.sec_'.$1.'_'.$2.'_'.$3};
 		}
 		# Assign the role and report it
-		$r->print('Assigning: '.$3.' in '.$url.': '.
+		$r->print('Assigning: '.$3.' in '.$url.
+                         ($start?', starting '.localtime($start):'').
+                         ($end?', ending '.localtime($end):'').': '.
                           &Apache::lonnet::assignrole(
                               $ENV{'form.ccdomain'},$ENV{'form.ccuname'},
                               $url,$3,$end,$start).