* Added password starred-out entry to newprompt() and strprompt()
authorArt Cancro <ajc@citadel.org>
Sun, 3 Mar 2002 06:31:58 +0000 (06:31 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 3 Mar 2002 06:31:58 +0000 (06:31 +0000)
* Applied the above setting to password set/change in <.A>ide <U>seredit

citadel/ChangeLog
citadel/commands.c
citadel/routines.c

index fe3a6ec4f0a9fc1140532acb74499ba244c5f1d9..616605d1b4749b3ccc9a6f78a5f6b00b71f1b945 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 590.123  2002/03/03 06:31:58  ajc
+ * Added password starred-out entry to newprompt() and strprompt()
+ * Applied the above setting to password set/change in <.A>ide <U>seredit
+
  Revision 590.122  2002/03/03 06:18:45  ajc
  * Implemented the CREU server command to administratively create user accounts
  * Added the ability to create new user accounts to <.A>ide <U>seredit
@@ -3376,4 +3380,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index ffd36bdabcef1fe66d4c6b1fc7a3029ad82c0a3d..ea115ed15cce50effaaf1fdb7b63f8975d7849d6 100644 (file)
@@ -567,14 +567,25 @@ void getline(char *string, int lim)
  */
 void strprompt(char *prompt, char *str, int len)
 {
+       int i;
        char buf[128];
+
        print_express();
        color(DIM_WHITE);
        scr_printf("%s ", prompt);
        color(DIM_MAGENTA);
        scr_printf("[");
        color(BRIGHT_MAGENTA);
-       scr_printf("%s", str);
+
+       if (len >= 0) {
+               scr_printf("%s", str);
+       }
+       else {
+               for (i=0; i<strlen(str); ++i) {
+                       scr_printf("*");
+               }
+       }
+
        color(DIM_MAGENTA);
        scr_printf("]");
        color(DIM_WHITE);
index 007be566c770de5aa3c625e263c250da58963d65..55e8f94d28d0f9f56a2e6741669ad6efbe560c6e 100644 (file)
@@ -119,6 +119,7 @@ void edituser(void)
        long usernum;
        time_t lastcall;
        int userpurge;
+       int newnow = 0;
 
        newprompt("User name: ",who,25);
 AGUP:  sprintf(buf,"AGUP %s",who);
@@ -131,7 +132,10 @@ AGUP:      sprintf(buf,"AGUP %s",who);
                        sprintf(buf, "CREU %s", who);
                        serv_puts(buf);
                        serv_gets(buf);
-                       if (buf[0] == '2') goto AGUP;
+                       if (buf[0] == '2') {
+                               newnow = 1;
+                               goto AGUP;
+                       }
                        scr_printf("%s\n",&buf[4]);
                        return;
                }
@@ -148,9 +152,14 @@ AGUP:      sprintf(buf,"AGUP %s",who);
        userpurge = extract_int(&buf[4], 8);
 
        val_user(who, 0); /* Display registration */
-       if (boolprompt("Change password", 0)) {
-               strprompt("Password", pass, 19);
+
+       if (newnow) {
+               newprompt("Password: ", pass, -19);
        }
+       else if (boolprompt("Change password", 0)) {
+               strprompt("Password", pass, -19);
+       }
+
        axlevel = intprompt("Access level", axlevel, 0, 6);
        if (boolprompt("Ask user to register again", !(flags & US_REGIS)))
                flags &= ~US_REGIS;