link when editing user's own vCard in the My Citadel Config> room.
$Log$
+Revision 323.10 2002/03/07 04:56:09 ajc
+* Final polish for initial round of vCard editing functions. Only show "edit"
+ link when editing user's own vCard in the My Citadel Config> room.
+
Revision 323.9 2002/03/06 05:22:33 ajc
* More vcard editing form stuff
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
wprintf("<TABLE bgcolor=#888888>");
if (v->numprops) for (i=0; i<(v->numprops); ++i) {
if (!strcasecmp(v->prop[i].name, "n")) {
- wprintf("<TR BGCOLOR=#AAAAAA><TD><FONT SIZE=+1><B>");
+ wprintf("<TR BGCOLOR=#AAAAAA>"
+ "<TD BGCOLOR=#FFFFFF>"
+ "<IMG VALIGN=CENTER SRC=\"/static/vcard.gif\"></TD>"
+ "<TD><FONT SIZE=+1><B>");
escputs(v->prop[i].value);
wprintf("</B></FONT></TD></TR>\n");
}
vcard_source = load_mimepart(msgnum, vcard_partnum);
if (vcard_source != NULL) {
- /* FIXME this is a temporary hack to make the screen usable
- * while we build it. We need a more intuitive way of getting
- * in.
- */
- wprintf("<A HREF=\"/edit_vcard?msgnum=%ld&partnum=%s\">",
- msgnum, vcard_partnum);
- wprintf("(edit)</A>");
+ /* If it's my vCard I can edit it */
+ if (!strcasecmp(WC->wc_roomname, USERCONFIGROOM)) {
+ wprintf("<A HREF=\"/edit_vcard?"
+ "msgnum=%ld&partnum=%s\">",
+ msgnum, vcard_partnum);
+ wprintf("(edit)</A>");
+ }
+ /* In all cases, display it */
display_vcard(vcard_source);
free(vcard_source);
}
struct vCard *v;
int i;
char *key, *value;
+ char whatuser[SIZ];
char lastname[SIZ];
char firstname[SIZ];
extrafields[0] = 0;
output_headers(1);
+
+ strcpy(whatuser, "");
+ sprintf(buf, "MSG0 %s|1", bstr("msgnum") );
+ serv_puts(buf);
+ serv_gets(buf);
+ if (buf[0] != '1') {
+ wDumpContent(1);
+ return;
+ }
+ while (serv_gets(buf), strcmp(buf, "000")) {
+ if (!strncasecmp(buf, "from=", 5)) {
+ strcpy(whatuser, &buf[5]);
+ }
+ else if (!strncasecmp(buf, "node=", 5)) {
+ strcat(whatuser, " @ ");
+ strcat(whatuser, &buf[5]);
+ }
+ }
+
+ total_len = atoi(&buf[4]);
+
+
sprintf(buf, "OPNA %s|%s", bstr("msgnum"), bstr("partnum") );
serv_puts(buf);
serv_gets(buf);
/* Display the form */
wprintf("<FORM METHOD=\"POST\" ACTION=\"/submit_vcard\">\n");
wprintf("<H2><IMG VALIGN=CENTER SRC=\"/static/vcard.gif\">"
- "Contact information for FIXME</H2>\n");
+ "Contact information for ");
+ escputs(whatuser);
+ wprintf("</H2>\n");
wprintf("<TABLE border=0><TR>"
"<TD>Prefix</TD>"
void submit_vcard(void) {
char buf[SIZ];
+ if (strcmp(bstr("sc"), "OK")) {
+ readloop("readnew");
+ return;
+ }
sprintf(buf, "ENT0 1|||4||");
fprintf(stderr, "%s\n", buf);
serv_puts("end:vcard");
serv_puts("000");
- edit_vcard();
+ readloop("readnew");
}
#define INITIAL_WORKER_THREADS 5
#define LISTEN_QUEUE_LENGTH 100 /* listen() backlog queue */
+#define USERCONFIGROOM "My Citadel Config"
+
/* Room flags (from Citadel) */
#define QR_PERMANENT 1 /* Room does not purge */