]> code.citadel.org Git - citadel.git/blobdiff - webcit/sieve.c
* check the buffersize while base64 encoding; and adjust it if needed.
[citadel.git] / webcit / sieve.c
index 9c81a861e3ed02ded1c5689f27968f879789ea5d..d2adb28d4adbe5cf656cda93cea00fcd48450155 100644 (file)
@@ -73,13 +73,13 @@ void display_sieve(void)
        );
 
        wprintf("<div id=\"banner\">\n");
-       wprintf("<TABLE class=\"sieve_banner\"><TR><TD>");
-       wprintf("<SPAN CLASS=\"titlebar\">"
-               "<img src=\"static/advanpage2_48x.gif\">");
+       wprintf("<img src=\"static/advanpage2_48x.gif\">");
+       wprintf("<h1>");
        wprintf(_("View/edit server-side mail filters"));
-       wprintf("</SPAN>\n");
-       wprintf("</TD></TR></TABLE>\n");
-       wprintf("</div>\n<div id=\"content\">\n");
+       wprintf("</h1>\n");
+       wprintf("</div>\n");
+
+       wprintf("<div id=\"content\" class=\"service\">\n");
 
        wprintf("<div class=\"fix_scrollbar_bug\">"
                "<table class=\"sieve_background\">"
@@ -425,9 +425,12 @@ void parse_fields_from_rule_editor(void) {
        char buf[256];
        char fname[256];
        char rule[2048];
-       char encoded_rule[4096];
+       char encoded_rule;
        char my_addresses[4096];
+       long encoded_len;
        
+       encoded_len = 4096;
+       encoded_rule = (char*) malloc (encoded_len);
        /* Enumerate my email addresses in case they are needed for a vacation rule */
        my_addresses[0] = 0;
        serv_puts("GVEA");
@@ -506,7 +509,7 @@ void parse_fields_from_rule_editor(void) {
                                redirect, automsg, final
                        );
        
-                       CtdlEncodeBase64(encoded_rule, rule, strlen(rule)+1, 0);
+                       CtdlEncodeBase64(&encoded_rule, rule, strlen(rule)+1, &encoded_len, 0);
                        serv_printf("# WEBCIT_RULE|%d|%s|", i, encoded_rule);
                        output_sieve_rule(hfield, compare, htext, sizecomp, sizeval,
                                        action, fileinto, redirect, automsg, final, my_addresses);
@@ -518,7 +521,7 @@ void parse_fields_from_rule_editor(void) {
 
        serv_puts("stop;");
        serv_puts("000");
-
+       free(encoded_rule);
 }
 
 
@@ -609,14 +612,12 @@ void display_add_remove_scripts(char *message)
 
        output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n");
-       wprintf("<table class=\"sieve_banner\"><tr>"
-               "<td>"
-               "<span class=\"titlebar\">"
-               "<img src=\"static/advanpage2_48x.gif\">");
+       wprintf("<img src=\"static/advanpage2_48x.gif\">");
        wprintf(_("Add or delete scripts"));
-       wprintf("</span></td></tr></table>\n"
-               "</div>\n<div id=\"content\">\n"
-       );
+       wprintf("</h1>\n");
+       wprintf("</div>\n");
+       
+       wprintf("<div id=\"content\" class=\"service\">\n");
 
        if (message != NULL) wprintf(message);