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

raeburn raeburn at source.lon-capa.org
Thu Nov 10 09:08:37 EST 2022


raeburn		Thu Nov 10 14:08:37 2022 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  - Remove trailing whitespace
  - Add a missing space in an html tag
  - Coding style - use scalar instead of numbered regex match
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.460 loncom/interface/loncreateuser.pm:1.461
--- loncom/interface/loncreateuser.pm:1.460	Tue Oct 18 23:28:00 2022
+++ loncom/interface/loncreateuser.pm	Thu Nov 10 14:08:37 2022
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.460 2022/10/18 23:28:00 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.461 2022/11/10 14:08:37 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1618,7 +1618,7 @@
                 if ($newuser) {
                     $r->print(' onclick="auth_check()" \>'."\n");
                 } else {
-                    $r->print('onclick="this.form.submit()" \>'."\n");
+                    $r->print(' onclick="this.form.submit()" \>'."\n");
                 }
             } else {
                 $r->print('</fieldset></div>'.
@@ -3127,7 +3127,7 @@
                 }
             } elsif ($context eq 'author') {
                 if ($rolenum eq $auname && $roledom eq $audom) {
-                    if (!grep(/^\Q$role\E$/, at userroles)) { 
+                    if (!grep(/^\Q$role\E$/, at userroles)) {
                         push(@userroles,$role);
                     }
                 }
@@ -4103,9 +4103,9 @@
 		    my $result=&Apache::lonnet::assignrole($env{'form.ccdomain'},
                                $env{'form.ccuname'},$url,$role,0,$now,'','',
                                $context);
-                        $output = &Apache::lonhtmlcommon::confirm_success(&mt('Re-enabling [_1] in [_2]',
-                                        &Apache::lonnet::plaintext($role),
-                                        &Apache::loncommon::show_role_extent($url,$context,$role)),$result ne "ok").'<br />';
+                    $output = &Apache::lonhtmlcommon::confirm_success(&mt('Re-enabling [_1] in [_2]',
+                                    &Apache::lonnet::plaintext($role),
+                                    &Apache::loncommon::show_role_extent($url,$context,$role)),$result ne "ok").'<br />';
                     if ($result ne "ok") {
                         $output .= &mt('Error: [_1]',$result).'<br />';
                     }
@@ -4150,7 +4150,7 @@
                                                                                      
                 # split multiple sections
                 my %sections = ();
-                my $num_sections = &build_roles($env{'form.sec_'.$full},\%sections,$5);
+                my $num_sections = &build_roles($env{'form.sec_'.$full},\%sections,$five);
                 if ($num_sections == 0) {
                     $r->print(&Apache::loncommon::commit_customrole($udom,$uname,$url,$three,$four,$five,$start,$end,$context));
                 } else {
@@ -4173,10 +4173,10 @@
 		# Activate roles for sections with 3 id numbers
 		# set start, end times, and the url for the class
 		my ($one,$two,$three)=($1,$2,$3);
-		my $start = ( $env{'form.start_'.$one.'_'.$two.'_'.$three} ? 
-			      $env{'form.start_'.$one.'_'.$two.'_'.$three} : 
+		my $start = ( $env{'form.start_'.$one.'_'.$two.'_'.$three} ?
+			      $env{'form.start_'.$one.'_'.$two.'_'.$three} :
 			      $now );
-		my $end   = ( $env{'form.end_'.$one.'_'.$two.'_'.$three} ? 
+		my $end   = ( $env{'form.end_'.$one.'_'.$two.'_'.$three} ?
 			      $env{'form.end_'.$one.'_'.$two.'_'.$three} :
 			      0 );
 		my $url='/'.$one.'/'.$two;
@@ -4186,7 +4186,7 @@
                 my $num_sections = &build_roles($env{'form.sec_'.$one.'_'.$two.'_'.$three},\%sections,$three);
                 my $credits;
                 if ($three eq 'st') {
-                    if ($showcredits) { 
+                    if ($showcredits) {
                         my $defaultcredits = 
                             &Apache::lonuserutils::get_defaultcredits($one,$two);
                         $credits = $env{'form.credits_'.$one.'_'.$two.'_'.$three};
@@ -4226,10 +4226,10 @@
 	    } elsif ($key=~/^form\.act\_([^\_]+)\_([^\_]+)$/) {
 		# Activate roles for sections with two 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} ?
+			      $env{'form.start_'.$1.'_'.$2} :
 			      $now );
-		my $end   = ( $env{'form.end_'.$1.'_'.$2} ? 
+		my $end   = ( $env{'form.end_'.$1.'_'.$2} ?
 			      $env{'form.end_'.$1.'_'.$2} :
 			      0 );
                 my $one = $1;




More information about the LON-CAPA-cvs mailing list