From: Art Cancro Date: Tue, 2 Oct 2007 21:58:51 +0000 (+0000) Subject: Saving vCards now requires the API caller to specify the room X-Git-Tag: v7.86~3032 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=a75646c26397f5718a48a28c40fc773264c171ed Saving vCards now requires the API caller to specify the room name. This name is passed along through the form as a hidden field, and prevents the vCard from being saved in the wrong room. --- diff --git a/webcit/auth.c b/webcit/auth.c index 505d8ccb8..cc48386bc 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -445,10 +445,10 @@ void display_reg(int during_login) } if (during_login) { - do_edit_vcard(vcard_msgnum, "1", "do_welcome"); + do_edit_vcard(vcard_msgnum, "1", "do_welcome", USERCONFIGROOM); } else { - do_edit_vcard(vcard_msgnum, "1", "display_main_menu"); + do_edit_vcard(vcard_msgnum, "1", "display_main_menu", USERCONFIGROOM); } } diff --git a/webcit/messages.c b/webcit/messages.c index abe91b05e..a173d1981 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -3008,7 +3008,7 @@ void display_enter(void) * message" command really means "add new entry." */ if (WC->wc_default_view == VIEW_ADDRESSBOOK) { - do_edit_vcard(-1, "", ""); + do_edit_vcard(-1, "", "", WC->wc_roomname); return; } diff --git a/webcit/useredit.c b/webcit/useredit.c index 16f4c48f7..39f42f760 100644 --- a/webcit/useredit.c +++ b/webcit/useredit.c @@ -208,7 +208,7 @@ void display_edit_address_book_entry(char *username, long usernum) { return; } - do_edit_vcard(vcard_msgnum, "1", "select_user_to_edit"); + do_edit_vcard(vcard_msgnum, "1", "select_user_to_edit", roomname); } diff --git a/webcit/vcard_edit.c b/webcit/vcard_edit.c index d7edb879f..52cea9bd0 100644 --- a/webcit/vcard_edit.c +++ b/webcit/vcard_edit.c @@ -18,7 +18,7 @@ * \param partnum what??? * \param return_to where to go back in the browser after edit ???? */ -void do_edit_vcard(long msgnum, char *partnum, char *return_to) { +void do_edit_vcard(long msgnum, char *partnum, char *return_to, char *force_room) { char buf[SIZ]; char *serialized_vcard = NULL; size_t total_len = 0; @@ -181,6 +181,13 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { wprintf("
\n"); wprintf("\n", WC->nonce); + + if (force_room != NULL) { + wprintf("\n"); + } + wprintf("
" "
\n"); @@ -344,7 +351,7 @@ void edit_vcard(void) { msgnum = atol(bstr("msgnum")); partnum = bstr("partnum"); - do_edit_vcard(msgnum, partnum, ""); + do_edit_vcard(msgnum, partnum, "", NULL); } @@ -363,6 +370,10 @@ void submit_vcard(void) { return; } + if (!IsEmptyStr(bstr("force_room"))) { + gotoroom(bstr("force_room")); + } + sprintf(buf, "ENT0 1|||4||"); serv_puts(buf); serv_getln(buf, sizeof buf); diff --git a/webcit/webcit.h b/webcit/webcit.h index 5b7f2778e..96367bea0 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -593,7 +593,7 @@ long extract_token(char *dest, const char *source, int parmnum, char separator, void remove_token(char *source, int parmnum, char separator); char *load_mimepart(long msgnum, char *partnum); int pattern2(char *search, char *patn); -void do_edit_vcard(long, char *, char *); +void do_edit_vcard(long, char *, char *, char *); void edit_vcard(void); void submit_vcard(void); void striplt(char *);