* auth.c: shrink the margins on the login screen so the user sees something
authorArt Cancro <ajc@citadel.org>
Mon, 7 Mar 2005 04:03:29 +0000 (04:03 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 7 Mar 2005 04:03:29 +0000 (04:03 +0000)
  resembling a window.
* Allow editing of address book entries wherever possible.
* Anything that was a (link) is now a [link]

webcit/ChangeLog
webcit/auth.c
webcit/messages.c
webcit/vcard.c
webcit/vcard_edit.c
webcit/who.c

index 73906490cab6b2506b322e0208fb9e07e478d0a1..92e2199046f1aebd9afba281a6fca26e4c36dece 100644 (file)
@@ -1,4 +1,10 @@
 $Log$
+Revision 603.9  2005/03/07 04:03:28  ajc
+* auth.c: shrink the margins on the login screen so the user sees something
+  resembling a window.
+* Allow editing of address book entries wherever possible.
+* Anything that was a (link) is now a [link]
+
 Revision 603.8  2005/03/07 01:45:30  ajc
 * Rolled back to the old RTE because the new one doesn't work in Safari.
 
@@ -2463,6 +2469,3 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
-
-
-
index a5d87b08db59a2a349702940bf1328623a5188a8..a837c275f4e6884b2eeec9d2aaff8fcdbf0c1855 100644 (file)
@@ -47,7 +47,7 @@ void display_login(char *mesg)
 
        output_headers(1, 1, 2, 0, 0, 0, 0);
        //wprintf("<div id=\"content\">\n");
-       wprintf("<div>\n");
+       wprintf("<div style=\"position:absolute; top:20px; left:20px; right:20px\">\n");
 
        if (mesg != NULL) if (strlen(mesg) > 0) {
                stresc(buf, mesg, 0, 0);
index 4edb1e3396bd6b3f68136a83b910dc775d28a0a7..1af10564cfe5cd37fdb107c74b31945aa7ea0943 100644 (file)
@@ -323,9 +323,10 @@ void display_vcard(char *vcard_source, char alpha, int full, char *storename) {
        if (storename != NULL) {
                fetchname_parsed_vcard(v, storename);
        }
-       else if ( (alpha == 0)
-          || ((isalpha(alpha)) && (tolower(alpha) == tolower(this_alpha)) )
-          || ((!isalpha(alpha)) && (!isalpha(this_alpha))) ) {
+       else if (       (alpha == 0)
+                       || ((isalpha(alpha)) && (tolower(alpha) == tolower(this_alpha)) )
+                       || ((!isalpha(alpha)) && (!isalpha(this_alpha)))
+               ) {
                display_parsed_vcard(v, full);
        }
 
@@ -613,12 +614,14 @@ void read_message(long msgnum) {
                if (part_source != NULL) {
 
                        /* If it's my vCard I can edit it */
-                       if ( (!strcasecmp(WC->wc_roomname, USERCONFIGROOM))
-                          || (!strcasecmp(&WC->wc_roomname[11], USERCONFIGROOM))) {
+                       if (    (!strcasecmp(WC->wc_roomname, USERCONFIGROOM))
+                               || (!strcasecmp(&WC->wc_roomname[11], USERCONFIGROOM))
+                               || (WC->wc_view == VIEW_ADDRESSBOOK)
+                       ) {
                                wprintf("<A HREF=\"/edit_vcard?"
                                        "msgnum=%ld&partnum=%s\">",
                                        msgnum, vcard_partnum);
-                               wprintf("(edit)</A>");
+                               wprintf("[edit]</A>");
                        }
 
                        /* In all cases, display the full card */
@@ -775,12 +778,14 @@ void display_addressbook(long msgnum, char alpha) {
                        display_vcard(vcard_source, alpha, 0, NULL);
 
                        /* If it's my vCard I can edit it */
-                       if ( (!strcasecmp(WC->wc_roomname, USERCONFIGROOM))
-                          || (!strcasecmp(&WC->wc_roomname[11], USERCONFIGROOM))) {
+                       if (    (!strcasecmp(WC->wc_roomname, USERCONFIGROOM))
+                               || (!strcasecmp(&WC->wc_roomname[11], USERCONFIGROOM))
+                               || (WC->wc_view == VIEW_ADDRESSBOOK)
+                       ) {
                                wprintf("<A HREF=\"/edit_vcard?"
                                        "msgnum=%ld&partnum=%s\">",
                                        msgnum, vcard_partnum);
-                               wprintf("(edit)</A>");
+                               wprintf("[edit]</A>");
                        }
 
                        free(vcard_source);
index 59f99f7febb888dddc108bce5316457984aad1f2..7c1ebae8625d4067e09e56cd18603849b5c95090 100644 (file)
@@ -3,7 +3,7 @@
  *
  * vCard data type implementation for Citadel/UX
  *
- * Copyright (C) 1999-2004 by Art Cancro
+ * Copyright (C) 1999-2005 by Art Cancro
  * This code is freely redistributable under the terms of the GNU General
  * Public License.  All other rights reserved.
  */
@@ -63,6 +63,7 @@ struct vCard *vcard_load(char *vtext) {
        int i;
        int colonpos, nlpos;
 
+       if (vtext == NULL) return vcard_new();
        mycopy = strdup(vtext);
        if (mycopy == NULL) return NULL;
 
@@ -97,15 +98,20 @@ struct vCard *vcard_load(char *vtext) {
                        strncpy(valuebuf, &ptr[colonpos+1], nlpos-colonpos-1);
                        valuebuf[nlpos-colonpos-1] = 0;
 
-                       if ( (!strcasecmp(namebuf, "end"))
-                          && (!strcasecmp(valuebuf, "vcard")) )  valid = 0;
-                       if ( (!strcasecmp(namebuf, "begin"))
-                          && (!strcasecmp(valuebuf, "vcard")) )  valid = 1;
+                       if (!strcasecmp(namebuf, "end")) {
+                               valid = 0;
+                       }
+                       if (    (!strcasecmp(namebuf, "begin"))
+                               && (!strcasecmp(valuebuf, "vcard"))
+                       ) {
+                               valid = 1;
+                       }
 
                        if ( (valid) && (strcasecmp(namebuf, "begin")) ) {
                                ++v->numprops;
                                v->prop = realloc(v->prop,
-                                       (v->numprops * sizeof(char *) * 2) );
+                                       (v->numprops * sizeof(struct vCardProp))
+                               );
                                v->prop[v->numprops-1].name = namebuf;
                                v->prop[v->numprops-1].value = valuebuf;
                        } 
@@ -208,7 +214,7 @@ void vcard_set_prop(struct vCard *v, char *name, char *value, int append) {
        /* Otherwise, append it */
        ++v->numprops;
        v->prop = realloc(v->prop,
-               (v->numprops * sizeof(char *) * 2) );
+               (v->numprops * sizeof(struct vCardProp)) );
        v->prop[v->numprops-1].name = strdup(name);
        v->prop[v->numprops-1].value = strdup(value);
 }
index d9aca9dd209e6e418ef554646e01de025bcbed41..fb18a33e417f86b8db157ed4e2a1a03f70f931c3 100644 (file)
@@ -106,13 +106,13 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) {
                }
        
                total_len = atoi(&buf[4]);
-               serialized_vcard = malloc(total_len + 1);
+               serialized_vcard = malloc(total_len + 2);
        
                read_server_binary(serialized_vcard, total_len);
        
                serv_puts("CLOS");
                serv_gets(buf);
-               serialized_vcard[total_len + 1] = 0;
+               serialized_vcard[total_len] = 0;
        
                v = vcard_load(serialized_vcard);
                free(serialized_vcard);
index d57b18504b2fdab013da5bf753f2615ee2b56c76..bc4a55246c08e4e9944c0d833a26348402bb0e09 100644 (file)
@@ -102,11 +102,11 @@ void whobbs(void)
                                wprintf(" <A HREF=\"/terminate_session&which_session=%d&session_owner=", sess);
                                urlescputs(user);
                                wprintf("\" onClick=\"return ConfirmKill();\" "
-                               ">(kill)</A>");
+                               ">[kill]</A>");
                        }
                        if (sess == WC->ctdl_pid) {
                                wprintf(" <A HREF=\"/edit_me\" "
-                                       ">(edit)</A>");
+                                       ">[edit]</A>");
                        }
                        wprintf("</TD>");