* updated listsorts to have '0' as sort order in all places that used SortByHashKey
[citadel.git] / webcit / siteconfig.c
index a68a6c7464a38f7707556adee384fdb1f85d2f30..b062a391d8eb13f8e49c6f7d95477a2b61289ea4 100644 (file)
@@ -64,7 +64,7 @@ void display_siteconfig(void)
                _("Auto-purger"),
                _("Indexing/Journaling"),
                _("Push Email"),
-               _("Pop3 Fetching")
+               _("Pop3")
        };
 
        sprintf(general, "<center><h1>%s</h1><table border=\"0\">",
@@ -109,7 +109,7 @@ void display_siteconfig(void)
                );
 
        sprintf(pop3, "<center><h1>%s</h1><table border=\"0\">",
-               _("POP3 Mail Fetching")
+               _("POP3")
                );
                
        wprintf("<form method=\"post\" action=\"siteconfig\">\n");
@@ -294,11 +294,11 @@ void display_siteconfig(void)
                        sprintf(&tuning[strlen(tuning)], "</td></tr>\n");
                        break;
                case 23:
-                       sprintf(&network[strlen(network)], "<tr><td>");
-                       sprintf(&network[strlen(network)], _("POP3 listener port (-1 to disable)"));
-                       sprintf(&network[strlen(network)], "</td><td>");
-                       sprintf(&network[strlen(network)], "<input type=\"text\" name=\"c_pop3_port\" maxlength=\"5\" value=\"%s\">", buf);
-                       sprintf(&network[strlen(network)], "</TD></TR>\n");
+                       sprintf(&pop3[strlen(pop3)], "<tr><td>");
+                       sprintf(&pop3[strlen(pop3)], _("POP3 listener port (-1 to disable)"));
+                       sprintf(&pop3[strlen(pop3)], "</td><td>");
+                       sprintf(&pop3[strlen(pop3)], "<input type=\"text\" name=\"c_pop3_port\" maxlength=\"5\" value=\"%s\">", buf);
+                       sprintf(&pop3[strlen(pop3)], "</TD></TR>\n");
                        break;
                case 24:
                        sprintf(&network[strlen(network)], "<TR><TD>");
@@ -419,11 +419,11 @@ void display_siteconfig(void)
                        sprintf(&network[strlen(network)], "</TD></TR>\n");
                        break;
                case 40:
-                       sprintf(&network[strlen(network)], "<TR><TD>");
-                       sprintf(&network[strlen(network)], _("POP3 over SSL port (-1 to disable)"));
-                       sprintf(&network[strlen(network)], "</TD><TD>");
-                       sprintf(&network[strlen(network)], "<input type=\"text\" NAME=\"c_pop3s_port\" MAXLENGTH=\"5\" VALUE=\"%s\">", buf);
-                       sprintf(&network[strlen(network)], "</TD></TR>\n");
+                       sprintf(&pop3[strlen(pop3)], "<TR><TD>");
+                       sprintf(&pop3[strlen(pop3)], _("POP3 over SSL port (-1 to disable)"));
+                       sprintf(&pop3[strlen(pop3)], "</TD><TD>");
+                       sprintf(&pop3[strlen(pop3)], "<input type=\"text\" NAME=\"c_pop3s_port\" MAXLENGTH=\"5\" VALUE=\"%s\">", buf);
+                       sprintf(&pop3[strlen(pop3)], "</TD></TR>\n");
                        break;
                case 41:
                        sprintf(&network[strlen(network)], "<TR><TD>");
@@ -500,11 +500,12 @@ void display_siteconfig(void)
                        int z;
                        long len;
                        char this_zone[128];
-                       char *ZName, *ZNamee;
+                       char *ZName;
+                       void *ZNamee;
                        HashList *List;
                        HashPos  *it;
 
-                       List = NewHash();
+                       List = NewHash(1, NULL);
                        len = sizeof("UTC") + 1;
                        ZName = malloc(len + 1);
                        memcpy(ZName, "UTC", len + 1);
@@ -517,11 +518,11 @@ void display_siteconfig(void)
                                memcpy(ZName, this_zone, len + 1);
                                Put(List, ZName, len, ZName, NULL);
                        }
-                       SortByHashKey(List);
+                       SortByHashKey(List, 0);
                        it = GetNewHashPos();
-                       while (GetNextHashPos(List, it, &len, &ZName, (void**)&ZNamee)) {
+                       while (GetNextHashPos(List, it, &len, &ZName, &ZNamee)) {
                                sprintf(&general[strlen(general)], "<option %s value=\"%s\">%s</option>\n",
-                                       (!strcasecmp(ZName, buf) ? "selected" : ""),
+                                       (!strcasecmp((char*)ZName, buf) ? "selected" : ""),
                                        ZName, ZName
                                );
                        }
@@ -768,14 +769,14 @@ void siteconfig(void)
        serv_printf("%s", bstr("c_fqdn"));
        serv_printf("%s", bstr("c_humannode"));
        serv_printf("%s", bstr("c_phonenum"));
-       serv_printf("%s", ((!strcasecmp(bstr("c_creataide"), "yes") ? "1" : "0")));
+       serv_printf("%s", ((yesbstr("c_creataide") ? "1" : "0")));
        serv_printf("%s", bstr("c_sleeping"));
        serv_printf("%s", bstr("c_initax"));
-       serv_printf("%s", ((!strcasecmp(bstr("c_regiscall"), "yes") ? "1" : "0")));
-       serv_printf("%s", ((!strcasecmp(bstr("c_twitdetect"), "yes") ? "1" : "0")));
+       serv_printf("%s", ((yesbstr("c_regiscall") ? "1" : "0")));
+       serv_printf("%s", ((yesbstr("c_twitdetect") ? "1" : "0")));
        serv_printf("%s", bstr("c_twitroom"));
        serv_printf("%s", bstr("c_moreprompt"));
-       serv_printf("%s", ((!strcasecmp(bstr("c_restrict"), "yes") ? "1" : "0")));
+       serv_printf("%s", ((yesbstr("c_restrict") ? "1" : "0")));
        serv_printf("%s", bstr("c_bbs_city"));
        serv_printf("%s", bstr("c_sysadm"));
        serv_printf("%s", bstr("c_maxsessions"));
@@ -789,11 +790,11 @@ void siteconfig(void)
        serv_printf("%s", bstr("c_max_workers"));
        serv_printf("%s", bstr("c_pop3_port"));
        serv_printf("%s", bstr("c_smtp_port"));
-       serv_printf("%s", ((!strcasecmp(bstr("c_rfc822_strict_from"), "yes") ? "0" : "1"))); /* note: reverse bool */
-       serv_printf("%s", ((!strcasecmp(bstr("c_aide_zap"), "yes") ? "1" : "0")));
+       serv_printf("%s", ((yesbstr("c_rfc822_strict_from") ? "0" : "1"))); /* note: reverse bool */
+       serv_printf("%s", ((yesbstr("c_aide_zap") ? "1" : "0")));
        serv_printf("%s", bstr("c_imap_port"));
        serv_printf("%s", bstr("c_net_freq"));
-       serv_printf("%s", ((!strcasecmp(bstr("c_disable_newu"), "yes") ? "1" : "0")));
+       serv_printf("%s", ((yesbstr("c_disable_newu") ? "1" : "0")));
        serv_printf("1"); /* placeholder - this field is not in use */
        serv_printf("%s", bstr("c_purge_hour"));
        serv_printf("%s", bstr("c_ldap_host"));
@@ -806,12 +807,12 @@ void siteconfig(void)
        serv_printf("%s", bstr("c_imaps_port"));
        serv_printf("%s", bstr("c_pop3s_port"));
        serv_printf("%s", bstr("c_smtps_port"));
-       serv_printf("%s", ((!strcasecmp(bstr("c_enable_fulltext"), "yes") ? "1" : "0")));
-       serv_printf("%s", ((!strcasecmp(bstr("c_auto_cull"), "yes") ? "1" : "0")));
-       serv_printf("%s", ((!strcasecmp(bstr("c_instant_expunge"), "yes") ? "1" : "0")));
-       serv_printf("%s", ((!strcasecmp(bstr("c_allow_spoofing"), "yes") ? "1" : "0")));
-       serv_printf("%s", ((!strcasecmp(bstr("c_journal_email"), "yes") ? "1" : "0")));
-       serv_printf("%s", ((!strcasecmp(bstr("c_journal_pubmsgs"), "yes") ? "1" : "0")));
+       serv_printf("%s", ((yesbstr("c_enable_fulltext") ? "1" : "0")));
+       serv_printf("%s", ((yesbstr("c_auto_cull") ? "1" : "0")));
+       serv_printf("%s", ((yesbstr("c_instant_expunge") ? "1" : "0")));
+       serv_printf("%s", ((yesbstr("c_allow_spoofing") ? "1" : "0")));
+       serv_printf("%s", ((yesbstr("c_journal_email") ? "1" : "0")));
+       serv_printf("%s", ((yesbstr("c_journal_pubmsgs") ? "1" : "0")));
        serv_printf("%s", bstr("c_journal_dest"));
        serv_printf("%s", bstr("c_default_cal_zone"));
        serv_printf("%s", bstr("c_pftcpdict_port"));
@@ -821,20 +822,20 @@ void siteconfig(void)
        serv_printf("%s", bstr("c_funambol_port"));
        serv_printf("%s", bstr("c_funambol_source"));
        serv_printf("%s", bstr("c_funambol_auth"));
-       serv_printf("%s", ((!strcasecmp(bstr("c_rbl_at_greeting"), "yes") ? "1" : "0")));
+       serv_printf("%s", ((yesbstr("c_rbl_at_greeting") ? "1" : "0")));
        serv_printf("%s", bstr("c_master_user"));
        serv_printf("%s", bstr("c_master_pass"));
        serv_printf("%s", bstr("c_pager_program"));
-       serv_printf("%s", ((!strcasecmp(bstr("c_imap_keep_from"), "yes") ? "1" : "0")));
+       serv_printf("%s", ((yesbstr("c_imap_keep_from") ? "1" : "0")));
        serv_printf("%s", bstr("c_xmpp_c2s_port"));
        serv_printf("%s", bstr("c_xmpp_s2s_port"));
        serv_printf("%s", bstr("c_pop3_fetch"));
        serv_printf("%s", bstr("c_pop3_fastest"));
        serv_printf("000");
 
-       serv_printf("SPEX site|%d|%d", atoi(bstr("sitepolicy")), atoi(bstr("sitevalue")));
+       serv_printf("SPEX site|%d|%d", ibstr("sitepolicy"), ibstr("sitevalue"));
        serv_getln(buf, sizeof buf);
-       serv_printf("SPEX mailboxes|%d|%d", atoi(bstr("mboxpolicy")), atoi(bstr("mboxvalue")));
+       serv_printf("SPEX mailboxes|%d|%d", ibstr("mboxpolicy"), ibstr("mboxvalue"));
        serv_getln(buf, sizeof buf);
 
        strcpy(serv_info.serv_default_cal_zone, bstr("c_default_cal_zone"));