X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsiteconfig.c;h=041bcb1c26f5b0928e8f79b39ce8768d2c2da6bb;hb=7f5c03bd732302f360f6840f0d815ad3e644416d;hp=aa034ca83a49e790ebe4a7d57343718591bf7cf1;hpb=cfa7d8dcaa2bf3b270f3d7de31373cef2e60ff10;p=citadel.git diff --git a/webcit/siteconfig.c b/webcit/siteconfig.c index aa034ca83..041bcb1c2 100644 --- a/webcit/siteconfig.c +++ b/webcit/siteconfig.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Administrative screen for site-wide configuration */ @@ -11,779 +9,119 @@ HashList *ZoneHash = NULL; +ConstStr ExpirePolicyString = {CStrOf(roompolicy) }; +ConstStr ExpirePolicyStrings[][2] = { + { { CStrOf(roompolicy) } , { strof(roompolicy) "_value", sizeof(strof(roompolicy) "_value") - 1 } }, + { { CStrOf(floorpolicy) } , { strof(floorpolicy) "_value", sizeof(strof(floorpolicy) "_value") - 1 } }, + { { CStrOf(sitepolicy) } , { strof(sitepolicy) "_value", sizeof(strof(sitepolicy) "_value") - 1 } }, + { { CStrOf(mailboxespolicy)} , { strof(mailboxespolicy)"_value", sizeof(strof(mailboxespolicy)"_value") - 1 } } +}; -void LoadZoneFiles(void) +void LoadExpirePolicy(GPEXWhichPolicy which) { - icalarray *zones; - int z; - long len; - char this_zone[128]; - char *ZName; - - ZoneHash = NewHash(1, NULL); - len = sizeof("UTC") + 1; - ZName = malloc(len + 1); - memcpy(ZName, "UTC", len + 1); - Put(ZoneHash, ZName, len, ZName, NULL); - zones = icaltimezone_get_builtin_timezones(); - for (z = 0; z < zones->num_elements; ++z) { - strcpy(this_zone, icaltimezone_get_location(icalarray_element_at(zones, z))); - len = strlen(this_zone); - ZName = (char*)malloc(len +1); - memcpy(ZName, this_zone, len + 1); - Put(ZoneHash, ZName, len, ZName, NULL); + StrBuf *Buf; + wcsession *WCC = WC; + long State; + const char *Pos = NULL; + + serv_printf("GPEX %s", ExpirePolicyStrings[which][0].Key); + Buf = NewStrBuf(); + StrBuf_ServGetln(Buf); + WCC->Policy[which].loaded = 1; + if (GetServerStatus(Buf, &State) == 2) { + Pos = ChrPtr(Buf) + 4; + WCC->Policy[which].expire_mode = StrBufExtractNext_long(Buf, &Pos, '|'); + WCC->Policy[which].expire_value = StrBufExtractNext_long(Buf, &Pos, '|'); } - SortByHashKey(ZoneHash, 0); + else if (State == 550) + StrBufAppendBufPlain(WCC->ImportantMsg, + _("Higher access is required to access this function."), -1, 0); + FreeStrBuf(&Buf); } - - - -/* - * \brief display all configuration items - */ -void display_siteconfig(void) +void SaveExpirePolicyFromHTTP(GPEXWhichPolicy which) { - char buf[SIZ]; - int i, j; - struct wcsession *WCC = WC; - const char *VCZname; - - char general[65536]; - char access[SIZ]; - char network[SIZ]; - char tuning[SIZ]; - char directory[SIZ]; - char purger[SIZ]; - char idxjnl[SIZ]; - char funambol[SIZ]; - char pop3[SIZ]; - - /** expire policy settings */ - int sitepolicy = 0; - int sitevalue = 0; - int mboxpolicy = 0; - int mboxvalue = 0; - - output_headers(1, 1, 2, 0, 0, 0); - wprintf("
\n"); - - wprintf("");
-
- char *tabnames[] = {
- _("General"),
- _("Access"),
- _("Network"),
- _("Tuning"),
- _("Directory"),
- _("Auto-purger"),
- _("Indexing/Journaling"),
- _("Push Email"),
- _("Pop3")
- };
+ StrBuf *Buf;
+ long State;
- sprintf(general, "%s |