From 41cbb82d42bb85d599387de44568d86c638306f8 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 17 Jun 2002 03:48:44 +0000 Subject: [PATCH] * Finished the thing to edit other users' vCards. --- webcit/ChangeLog | 4 +++- webcit/useredit.c | 2 +- webcit/vcard_edit.c | 29 +++++++++++++++++++++++++---- webcit/webcit.h | 1 + 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 1e4801c87..47bb566f4 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,7 @@ $Log$ +Revision 323.41 2002/06/17 03:48:44 ajc +* Finished the thing to edit other users' vCards. + Revision 323.40 2002/06/16 21:49:02 ajc * Administratively edit other users' vCards. Still needs a couple of lines of glue code to make it work. @@ -839,4 +842,3 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix - diff --git a/webcit/useredit.c b/webcit/useredit.c index e47ed8dbb..540999254 100644 --- a/webcit/useredit.c +++ b/webcit/useredit.c @@ -180,7 +180,7 @@ TRYAGAIN: return; } - display_addressbook(vcard_msgnum, 0); + do_edit_vcard(vcard_msgnum, "1", "/select_user_to_edit"); } diff --git a/webcit/vcard_edit.c b/webcit/vcard_edit.c index f497730b9..1c156cce4 100644 --- a/webcit/vcard_edit.c +++ b/webcit/vcard_edit.c @@ -30,7 +30,7 @@ -void edit_vcard(void) { +void do_edit_vcard(long msgnum, char *partnum, char *return_to) { char buf[SIZ]; char *serialized_vcard = NULL; size_t total_len = 0; @@ -78,7 +78,7 @@ void edit_vcard(void) { output_headers(3); strcpy(whatuser, ""); - sprintf(buf, "MSG0 %s|1", bstr("msgnum") ); + sprintf(buf, "MSG0 %ld|1", msgnum); serv_puts(buf); serv_gets(buf); if (buf[0] != '1') { @@ -98,7 +98,7 @@ void edit_vcard(void) { total_len = atoi(&buf[4]); - sprintf(buf, "OPNA %s|%s", bstr("msgnum"), bstr("partnum") ); + sprintf(buf, "OPNA %ld|%s", msgnum, partnum); serv_puts(buf); serv_gets(buf); if (buf[0] != '2') { @@ -259,6 +259,10 @@ void edit_vcard(void) { escputs(extrafields); wprintf("\">\n"); + wprintf("\n"); + wprintf("
\n"); wprintf(""); wprintf(""); @@ -270,6 +274,18 @@ void edit_vcard(void) { +void edit_vcard(void) { + long msgnum; + char *partnum; + + msgnum = atol(bstr("msgnum")); + partnum = bstr("partnum"); + do_edit_vcard(msgnum, partnum, ""); +} + + + + void submit_vcard(void) { char buf[SIZ]; int i; @@ -318,5 +334,10 @@ void submit_vcard(void) { serv_puts("end:vcard"); serv_puts("000"); - readloop("readnew"); + if (!strcmp(bstr("return_to"), "/select_user_to_edit")) { + select_user_to_edit(NULL); + } + else { + readloop("readnew"); + } } diff --git a/webcit/webcit.h b/webcit/webcit.h index a3c6f4cb6..b462c3c86 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -292,6 +292,7 @@ void remove_token(char *source, int parmnum, char separator); int decode_base64(char *dest, char *source, size_t length); char *load_mimepart(long msgnum, char *partnum); int pattern2(char *search, char *patn); +void do_edit_vcard(long, char *, char *); void edit_vcard(void); void submit_vcard(void); void striplt(char *); -- 2.39.2