[LON-CAPA-cvs] cvs: loncom / lcpasswd lcuseradd

harris41 lon-capa-cvs@mail.lon-capa.org
Thu, 14 Feb 2002 22:09:14 -0000


harris41		Thu Feb 14 17:09:14 2002 EDT

  Modified files:              
    /loncom	lcpasswd lcuseradd 
  Log:
  map to foreach
  
  
Index: loncom/lcpasswd
diff -u loncom/lcpasswd:1.13 loncom/lcpasswd:1.14
--- loncom/lcpasswd:1.13	Thu Nov 15 13:34:57 2001
+++ loncom/lcpasswd	Thu Feb 14 17:09:14 2002
@@ -11,7 +11,7 @@
 # YEAR=2001
 # 10/22,10/23,11/13,11/15 Scott Harrison
 #
-# $Id: lcpasswd,v 1.13 2001/11/15 18:34:57 harris41 Exp $
+# $Id: lcpasswd,v 1.14 2002/02/14 22:09:14 harris41 Exp $
 ###
 
 ###############################################################################
@@ -120,7 +120,7 @@
     unlink('/tmp/lock_lcpasswd');
     exit 3;
 }
-map {chomp} @input;
+foreach (@input) {chomp;}
 
 my ($username,$password1,$password2)=@input;
 $username=~/^(\w+)$/;
@@ -131,8 +131,8 @@
     exit 9;
 }
 my $pbad=0;
-map {if (($_<32)&&($_>126)){$pbad=1;}} (split(//,$password1));
-map {if (($_<32)&&($_>126)){$pbad=1;}} (split(//,$password2));
+foreach (split(//,$password1)) {if (($_<32)&&($_>126)){$pbad=1;}}
+foreach (split(//,$password2)) {if (($_<32)&&($_>126)){$pbad=1;}}
 if ($pbad) {
     print "Error. A password entry had an invalid character.\n";
     unlink('/tmp/lock_lcpasswd');
Index: loncom/lcuseradd
diff -u loncom/lcuseradd:1.18 loncom/lcuseradd:1.19
--- loncom/lcuseradd:1.18	Fri Nov 16 01:18:35 2001
+++ loncom/lcuseradd	Thu Feb 14 17:09:14 2002
@@ -10,7 +10,7 @@
 # YEAR=2001
 # 10/21,11/13,11/15 Scott Harrison
 #
-# $Id: lcuseradd,v 1.18 2001/11/16 06:18:35 harris41 Exp $
+# $Id: lcuseradd,v 1.19 2002/02/14 22:09:14 harris41 Exp $
 ###
 
 ###############################################################################
@@ -151,7 +151,7 @@
 	unlink('/tmp/lock_lcpasswd');
 	exit 3;
     }
-    map {chomp} @input;
+    foreach (@input) {chomp;}
 }
 
 my ($username,$password1,$password2)=@input;
@@ -164,8 +164,8 @@
     exit 9;
 }
 my $pbad=0;
-map {if ((ord($_)<32)||(ord($_)>126)){$pbad=1;}} (split(//,$password1));
-map {if ((ord($_)<32)||(ord($_)>126)){$pbad=1;}} (split(//,$password2));
+foreach (split(//,$password1)) {if ((ord($_)<32)||(ord($_)>126)){$pbad=1;}}
+foreach (split(//,$password2)) {if ((ord($_)<32)||(ord($_)>126)){$pbad=1;}}
 if ($pbad) {
     print "Error. A password entry had an invalid character.\n";
     unlink('/tmp/lock_lcpasswd');