* Added support for non-USA country identities in vCard and registration
authorArt Cancro <ajc@citadel.org>
Tue, 5 Dec 2000 05:33:03 +0000 (05:33 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 5 Dec 2000 05:33:03 +0000 (05:33 +0000)
* User edit now asks whether it should prompt to change the password

citadel/ChangeLog
citadel/routines.c
citadel/routines2.c
citadel/serv_vcard.c
citadel/techdoc/session.txt

index cb9114fa8523bce4066e486a7e3cd4fa4f8dfd23..5966c8be4d947a4eb904b0b40d1474f3c688831c 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 573.38  2000/12/05 05:32:58  ajc
+ * Added support for non-USA country identities in vCard and registration
+ * User edit now asks whether it should prompt to change the password
+
  Revision 573.37  2000/12/03 04:12:21  ajc
  * Finished (mostly) the Sleepycat DB backend ... added transaction logging
 
@@ -2176,4 +2180,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 9b2db74e557a1c46fde5668bb9e5ccf643bc4504..9166bbb945c7c7b47e72addbaa6e3fd6009d1729 100644 (file)
@@ -118,7 +118,9 @@ void edituser(void)
        userpurge = extract_int(&buf[4], 8);
 
        val_user(who, 0); /* Display registration */
-       strprompt("Password", pass, 19);
+       if (boolprompt("Change password", 0)) {
+               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);
index e3f69c470c4743da223590cd8531fae6c00b9e2a..fd4fd01040ef4a2a0c6cf56b5b0225ecfd329c9e 100644 (file)
@@ -86,6 +86,7 @@ void entregis(void)
        char tmpzip[256];
        char tmpphone[256];
        char tmpemail[256];
+       char tmpcountry[256];
        int a;
 
        strcpy(tmpname, "");
@@ -95,6 +96,7 @@ void entregis(void)
        strcpy(tmpzip, "");
        strcpy(tmpphone, "");
        strcpy(tmpemail, "");
+       strcpy(tmpcountry, "");
 
        serv_puts("GREG _SELF_");
        serv_gets(buf);
@@ -115,14 +117,17 @@ void entregis(void)
                                strcpy(tmpphone, buf);
                        if (a == 9)
                                strcpy(tmpemail, buf);
+                       if (a == 10)
+                               strcpy(tmpcountry, buf);
                        ++a;
                }
        }
        strprompt("REAL name", tmpname, 29);
        strprompt("Address", tmpaddr, 24);
        strprompt("City/town", tmpcity, 14);
-       strprompt("State", tmpstate, 2);
-       strprompt("ZIP Code", tmpzip, 10);
+       strprompt("State/province", tmpstate, 2);
+       strprompt("ZIP/Postal Code", tmpzip, 10);
+       strprompt("Country", tmpcountry, 31);
        strprompt("Telephone number", tmpphone, 14);
        strprompt("Email address", tmpemail, 31);
 
@@ -140,6 +145,7 @@ void entregis(void)
        serv_puts(tmpzip);
        serv_puts(tmpphone);
        serv_puts(tmpemail);
+       serv_puts(tmpcountry);
        serv_puts("000");
        printf("\n");
 }
@@ -453,6 +459,8 @@ void val_user(char *user, int do_validate)
                                ax = atoi(buf);
                        if (a == 10)
                                printf("%s\n", buf);
+                       if (a == 11)
+                               printf("%s\n", buf);
                } while (strcmp(buf, "000"));
                printf("Current access level: %d (%s)\n", ax, axdefs[ax]);
        } else {
index e7a8e61bd4bbe91eec08528f20e3a8c6d0a258c5..6f1efad76aab90642d86ceddd6cd0e8e5b821a56 100644 (file)
@@ -284,6 +284,7 @@ void cmd_regi(char *argbuf) {
        char tmpstate[256];
        char tmpzip[256];
        char tmpaddress[512];
+       char tmpcountry[256];
 
        if (!(CC->logged_in)) {
                cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
@@ -295,6 +296,7 @@ void cmd_regi(char *argbuf) {
        strcpy(tmpcity, "");
        strcpy(tmpstate, "");
        strcpy(tmpzip, "");
+       strcpy(tmpcountry, "USA");
 
        cprintf("%d Send registration...\n", SEND_LISTING);
        a=0;
@@ -314,10 +316,11 @@ void cmd_regi(char *argbuf) {
                        }
                if (a==5) vcard_set_prop(my_vcard, "tel;home", buf);
                if (a==6) vcard_set_prop(my_vcard, "email;internet", buf);
+               if (a==7) strcpy(tmpcountry, buf);
                ++a;
                }
-       sprintf(tmpaddress, ";;%s;%s;%s;%s;USA",
-               tmpaddr, tmpcity, tmpstate, tmpzip);
+       sprintf(tmpaddress, ";;%s;%s;%s;%s;%s",
+               tmpaddr, tmpcity, tmpstate, tmpzip, tmpcountry);
        vcard_set_prop(my_vcard, "adr", tmpaddress);
        vcard_write_user(&CC->usersupp, my_vcard);
        vcard_free(my_vcard);
@@ -401,6 +404,11 @@ void cmd_greg(char *argbuf)
 
        s = vcard_get_prop(v, "email;internet", 0);
        cprintf("%s\n", s ? s : " ");
+       s = vcard_get_prop(v, "adr", 0);
+       sprintf(adr, "%s", s ? s : " ");/* address... */
+
+       extract_token(buf, adr, 6, ';');
+       cprintf("%s\n", buf);                           /* country */
        cprintf("000\n");
        }
 
index 5090e6296b90b144ce5d801a906d4cd5c1570e3f..ec288e94c7f86c26dd20cb27b2914d523ea14e4e 100644 (file)
@@ -911,6 +911,7 @@ all remaining lines:
  Line 8:  Telephone number
  Line 9:  Access level
  Line 10: Internet e-mail address
+ Line 11: Country
  
  Users without Aide privileges may retrieve their own registration using
 this command.  This can be accomplished either by passing the user's own
@@ -977,6 +978,7 @@ SEND_LISTING is returned, and the server will expect the following information
  Line 5:  ZIP Code
  Line 6:  Telephone number
  Line 7:  e-mail address
+ Line 8:  Country
  
  
  CHEK   (CHEcK various things)