src/hg/instinct/webUserAdmin/webUserAdmin.c 1.16

1.16 2010/04/23 21:45:50 sbenz
Made the default passwords a bit simpler (0-9A-Za-z) and removed the space from the letter that made it seem like you had the wrong pass
Index: src/hg/instinct/webUserAdmin/webUserAdmin.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/instinct/webUserAdmin/webUserAdmin.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -b -B -U 4 -r1.15 -r1.16
--- src/hg/instinct/webUserAdmin/webUserAdmin.c	23 Apr 2010 21:11:02 -0000	1.15
+++ src/hg/instinct/webUserAdmin/webUserAdmin.c	23 Apr 2010 21:45:50 -0000	1.16
@@ -108,9 +108,9 @@
 /* Smiliar to generateRandomPassword(), but with finer timer resolution seed */
 /* Generate valid random password for users who have lost their old one.
  * Free the returned value.*/
 {
-char boundary[256];
+char boundary[9];
 char punc[] = "!@#$%^&*()";
 char str[200];
 struct timeval tim;
 /* choose a new string for the boundary */
@@ -125,24 +125,25 @@
 srand((unsigned)tim.tv_usec);
 
 for(i=0;i<8;++i)
     {
-    r = randInt(4);
+    r = randInt(3);
     switch (r) 
 	{
 	case 0 :
     	    c = 'A' + randInt(26);
 	    break;
 	case 1 :
     	    c = 'a' + randInt(26);
 	    break;
-	case 2 :
+	default:
     	    c = '0' + randInt(10);
 	    break;
-	default:
+	/*default:
     	    c = punc[randInt(10)];
-	    break;
+	    break;*/
     	}
+	//hPrintf("%c\n",c);
     boundary[i] = c;
     }
 boundary[i]=0;
 return cloneString(boundary);
@@ -162,23 +163,23 @@
 boundary[0]=0;
 srand( (unsigned)time( NULL ) );
 for(i=0;i<8;++i)
     {
-    r = randInt(4);
+    r = randInt(3);
     switch (r) 
 	{
 	case 0 :
     	    c = 'A' + randInt(26);
 	    break;
 	case 1 :
     	    c = 'a' + randInt(26);
 	    break;
-	case 2 :
+	default:
     	    c = '0' + randInt(10);
 	    break;
-	default:
+	/*default:
     	    c = punc[randInt(10)];
-	    break;
+	    break;*/
     	}
     boundary[i] = c;
     }
 boundary[i]=0;
@@ -476,13 +477,15 @@
         int lineSize;
 
         while (lineFileNext(lf, &line, &lineSize))
 	    {
+	    if(sameString(line,""))
+			continue;
+
 	    char *password = generateRandomPasswordExtended();
+		//hPrintf(password);
 	    char encPwd[35] = "";
 	    char *webUserEmail;
-	    if(sameString(line,""))
-			continue;
 		
 	    webUserEmail = line;
 	    safef(query,sizeof(query), "insert ignore into webUsers set email='%s'", webUserEmail);
 	    sqlGetResult(conn, query);