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

raeburn raeburn at source.lon-capa.org
Wed Dec 10 20:20:50 EST 2014


raeburn		Thu Dec 11 01:20:50 2014 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  - Coding style: sort() keys()
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.403 loncom/interface/loncreateuser.pm:1.404
--- loncom/interface/loncreateuser.pm:1.403	Mon Jun 30 14:49:35 2014
+++ loncom/interface/loncreateuser.pm	Thu Dec 11 01:20:50 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.403 2014/06/30 14:49:35 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.404 2014/12/11 01:20:50 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3625,7 +3625,7 @@
     my @rolechanges;
     my %disallowed;
     $r->print('<h3>'.&mt('Modifying Roles').'</h3>');
-    foreach my $key (keys (%env)) {
+    foreach my $key (keys(%env)) {
 	next if (! $env{$key});
         next if ($key eq 'form.action');
 	# Revoke roles
@@ -3807,7 +3807,7 @@
                 } else {
 		    my %curr_groups =
 			&Apache::longroup::coursegroups($one,$two);
-                    foreach my $sec (sort {$a cmp $b} keys %sections) {
+                    foreach my $sec (sort {$a cmp $b} keys(%sections)) {
                         if (($sec eq 'none') || ($sec eq 'all') || 
                             exists($curr_groups{$sec})) {
                             $disallowed{$sec} = $url;
@@ -3853,7 +3853,7 @@
                     my %curr_groups = 
 			&Apache::longroup::coursegroups($one,$two);
                     my $emptysec = 0;
-                    foreach my $sec (sort {$a cmp $b} keys %sections) {
+                    foreach my $sec (sort {$a cmp $b} keys(%sections)) {
                         $sec =~ s/\W//g;
                         if ($sec ne '') {
                             if (($sec eq 'none') || ($sec eq 'all') || 
@@ -3893,7 +3893,7 @@
                     $r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$two,$start,$end,$one,undef,'',$context));
                 } else {
                     my $emptysec = 0;
-                    foreach my $sec (sort {$a cmp $b} keys %sections) {
+                    foreach my $sec (sort {$a cmp $b} keys(%sections)) {
                         if ($sec ne '') {
                             my $securl = $url.'/'.$sec;
                             $r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$securl,$two,$start,$end,$one,undef,$sec,$context));
@@ -7451,8 +7451,8 @@
         my $plrole=&Apache::lonnet::plaintext($role);
         $otheritems .= '  <option value="'.$role.'">'.$plrole.'</option>';
     }
-    if ( keys %customroles > 0) {
-        foreach my $cust (sort keys %customroles) {
+    if ( keys(%customroles) > 0) {
+        foreach my $cust (sort(keys(%customroles))) {
             my $custrole='cr_cr_'.$env{'user.domain'}.
                     '_'.$env{'user.name'}.'_'.$cust;
             $otheritems .= '  <option value="'.$custrole.'">'.$cust.'</option>';




More information about the LON-CAPA-cvs mailing list