]> code.citadel.org Git - citadel.git/blobdiff - webcit/webcit.c
* static.local/ is now created
[citadel.git] / webcit / webcit.c
index 85ee1ca4ba9e28af897fcee0279dcaf1dc18074d..803b877f8f2bd281dcfa8b9861fa0b798939c32a 100644 (file)
 #include "webserver.h"
 #include "mime_parser.h"
 
-/**
- * Subdirectories from which the client may request static content
- */
-char *static_content_dirs[] = {
-       "static",                     /** static templates */
-       "tiny_mce"                    /** the JS editor */
-};
-
 /**
  * String to unset the cookie.
  * Any date "in the past" will work, so I chose my birthday, right down to
@@ -110,6 +102,8 @@ void addurls(char *url)
                unescape_input(u->url_data);
                up = ptr;
                ++up;
+
+               /* lprintf(9, "%s = %s\n", u->url_key, u->url_data); */
        }
 }
 
@@ -435,6 +429,11 @@ void output_headers(       int do_httpheaders,     /**< 1 = output HTTP headers
 
        if (do_htmlhead) {
                begin_burst();
+               if (!access("static.local/webcit.css", R_OK)) {
+                       svprintf("CSSLOCAL", WCS_STRING,
+                          "<link href=\"static.local/webcit.css\" rel=\"stylesheet\" type=\"text/css\">"
+                       );
+               }
                do_template("head");
        }
 
@@ -700,17 +699,15 @@ char *load_mimepart(long msgnum, char *partnum)
        char content_type[SIZ];
        char *content;
        
-       serv_printf("OPNA %ld|%s", msgnum, partnum);
+       serv_printf("DLAT %ld|%s", msgnum, partnum);
        serv_getln(buf, sizeof buf);
-       if (buf[0] == '2') {
+       if (buf[0] == '6') {
                bytes = extract_long(&buf[4], 0);
                extract_token(content_type, &buf[4], 3, '|', sizeof content_type);
 
                content = malloc(bytes + 2);
-               read_server_binary(content, bytes);
+               serv_read(content, bytes);
 
-               serv_puts("CLOS");
-               serv_getln(buf, sizeof buf);
                content[bytes] = 0;     /* null terminate for good measure */
                return(content);
        }
@@ -1195,8 +1192,8 @@ void session_loop(struct httprequest *req)
 
        /** Static content can be sent without connecting to Citadel. */
        is_static = 0;
-       for (a=0; a<(sizeof(static_content_dirs) / sizeof(char *)); ++a) {
-               if (!strcasecmp(action, static_content_dirs[a])) {
+       for (a=0; a<ndirs; ++a) {
+               if (!strcasecmp(action, (char*)static_content_dirs[a])) { /* map web to disk location */
                        is_static = 1;
                }
        }
@@ -1438,6 +1435,8 @@ void session_loop(struct httprequest *req)
                readloop("readfwd");
        } else if (!strcasecmp(action, "headers")) {
                readloop("headers");
+       } else if (!strcasecmp(action, "do_search")) {
+               readloop("do_search");
        } else if (!strcasecmp(action, "msg")) {
                embed_message(arg1);
        } else if (!strcasecmp(action, "printmsg")) {
@@ -1626,6 +1625,20 @@ void session_loop(struct httprequest *req)
                display_inetconf();
        } else if (!strcasecmp(action, "save_inetconf")) {
                save_inetconf();
+       } else if (!strcasecmp(action, "display_smtpqueue")) {
+               display_smtpqueue();
+       } else if (!strcasecmp(action, "display_smtpqueue_inner_div")) {
+               display_smtpqueue_inner_div();
+       } else if (!strcasecmp(action, "display_sieve")) {
+               display_sieve();
+       } else if (!strcasecmp(action, "save_sieve")) {
+               save_sieve();
+       } else if (!strcasecmp(action, "display_add_remove_scripts")) {
+               display_add_remove_scripts(NULL);
+       } else if (!strcasecmp(action, "create_script")) {
+               create_script();
+       } else if (!strcasecmp(action, "delete_script")) {
+               delete_script();
        } else if (!strcasecmp(action, "setup_wizard")) {
                do_setup_wizard();
        } else if (!strcasecmp(action, "display_preferences")) {