]> code.citadel.org Git - citadel.git/commitdiff
Fixed a bug in the user editing command (client side)
authorArt Cancro <ajc@citadel.org>
Wed, 20 Jan 1999 02:29:04 +0000 (02:29 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 20 Jan 1999 02:29:04 +0000 (02:29 +0000)
citadel/ChangeLog
citadel/routines.c
citadel/routines2.c

index d6b3ada4fc4a0c1aac245ad9e1fb5d5179230b07..e47b973134f65e00a549e2e35c2e747deaa91d93 100644 (file)
@@ -1,3 +1,6 @@
+Tue Jan 19 21:28:29 EST 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * Fixed a bug in the user editing command (client side)
+
 Thu Jan 14 21:21:15 EST 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Brought over the mime_parser from WebCit and began preliminary work
          on supporting MIME format messages.
index ce3a16a380a3803450929d1da285a680aaeb7c26..8705c933054b6533504d756e4072ec468601b8ab 100644 (file)
@@ -26,7 +26,7 @@
 
 void sttybbs(int cmd);
 void newprompt(char *prompt, char *str, int len);
-void val_user(char *user);
+void val_user(char *, int);
 void formout(char *name);
 void logoff(int code);
 void set_keepalives(int s);
@@ -128,8 +128,9 @@ void edituser(void)
        lastcall = extract_long(&buf[4], 7);
        userpurge = extract_int(&buf[4], 8);
 
-       val_user(who); /* Display registration, and set access level */
+       val_user(who, 0); /* Display registration */
        strprompt("Password", pass, 19);
+       axlevel = intprompt("Access level", axlevel, 0, 6);
        timescalled = intprompt("Times called", timescalled, 0, INT_MAX);
        posted = intprompt("Messages posted", posted, 0, INT_MAX);
        lastcall = (boolprompt("Set last call to now", 0)?time(NULL):lastcall);
index 01364065c300e33b27796cd6cda40f4ccc4725f0..9ced0e5e62893c0aa8517fce971e1467b686cc7f 100644 (file)
@@ -394,14 +394,14 @@ void upload(int c)        /* c = upload mode */
 /* 
  * validate a user
  */
-void val_user(char *user)
+void val_user(char *user, int do_validate)
 {
        int a;
        char cmd[256];
        char buf[256];
        int ax = 0;
 
-       sprintf(cmd,"GREG %s",user);
+       sprintf(cmd, "GREG %s", user);
        serv_puts(cmd);
        serv_gets(cmd);
        if (cmd[0]=='1') {
@@ -409,8 +409,7 @@ void val_user(char *user)
                do {
                        serv_gets(buf);
                        ++a;
-                       if (a==1) printf("User #%s - %s  ",
-                               buf,&cmd[4]);
+                       if (a==1) printf("User #%s - %s  ", buf, &cmd[4]);
                        if (a==2) printf("PW: %s\n",buf);
                        if (a==3) printf("%s\n",buf);
                        if (a==4) printf("%s\n",buf);
@@ -427,12 +426,14 @@ void val_user(char *user)
                printf("%-30s\n%s\n",user,&cmd[4]);
                }
 
-       /* now set the access level */
-       ax = intprompt("Access level", ax, 0, 6);
-       sprintf(cmd,"VALI %s|%d",user,ax);
-       serv_puts(cmd);
-       serv_gets(cmd);
-       if (cmd[0]!='2') printf("%s\n",&cmd[4]);
+       if (do_validate) {
+               /* now set the access level */
+               ax = intprompt("Access level", ax, 0, 6);
+               sprintf(cmd,"VALI %s|%d",user,ax);
+               serv_puts(cmd);
+               serv_gets(cmd);
+               if (cmd[0]!='2') printf("%s\n",&cmd[4]);
+               }
        printf("\n");
        }
 
@@ -448,8 +449,8 @@ void validate(void) {       /* validate new users */
                if (cmd[0]!='3') finished = 1;
                if (cmd[0]=='2') printf("%s\n",&cmd[4]);
                if (cmd[0]=='3') {
-                       extract(buf,cmd,0);
-                       val_user(&buf[4]);
+                       extract(buf, cmd, 0);
+                       val_user(&buf[4], 1);
                        }
                } while(finished==0);
        }