");
+void SaveExpirePolicyFromHTTP(GPEXWhichPolicy which)
+{
+ StrBuf *Buf;
+ long State;
+
+ serv_printf("SPEX %s|%d|%d",
+ ExpirePolicyStrings[which][0].Key,
+ ibcstr( ExpirePolicyStrings[which][1] ),
+ ibcstr( ExpirePolicyStrings[which][1] ) );
+
+ Buf = NewStrBuf();
+ StrBuf_ServGetln(Buf);
+ GetServerStatus(Buf, &State);
+ if (State == 550)
+ StrBufAppendBufPlain(WC->ImportantMsg,
+ _("Higher access is required to access this function."), -1, 0);
+ FreeStrBuf(&Buf);
+}
- char *tabnames[] = {
- _("General"),
- _("Access"),
- _("Network"),
- _("Tuning"),
- _("Directory"),
- _("Auto-purger"),
- _("Indexing/Journaling")
- };
+int ConditionalExpire(StrBuf *Target, WCTemplputParams *TP)
+{
+ wcsession *WCC = WC;
+ GPEXWhichPolicy which;
+ int CompareWith;
- sprintf(general, "%s ",
- _("General site configuration items")
- );
+ which = GetTemplateTokenNumber(Target, TP, 2, 0);
+ CompareWith = GetTemplateTokenNumber(Target, TP, 3, 0);
- sprintf(access, "%s ",
- _("Access controls and site policy settings")
- );
+ if (WCC->Policy[which].loaded == 0) LoadExpirePolicy(which);
+
+ return WCC->Policy[which].expire_mode == CompareWith;
+}
- sprintf(network, "%s %s ",
- _("Network services"),
- _("Changes made on this screen will not take effect "
- "until you restart the Citadel server.")
- );
+void tmplput_ExpireValue(StrBuf *Target, WCTemplputParams *TP)
+{
+ GPEXWhichPolicy which;
+ wcsession *WCC = WC;
+
+ which = GetTemplateTokenNumber(Target, TP, 0, 0);
+ if (WCC->Policy[which].loaded == 0) LoadExpirePolicy(which);
+ StrBufAppendPrintf(Target, "%d", WCC->Policy[which].expire_value);
+}
- sprintf(tuning, "%s ",
- _("Advanced server fine-tuning controls")
- );
- sprintf(directory, "%s %s ",
- _("Configure the LDAP connector for Citadel"),
- _("Changes made on this screen will not take effect "
- "until you restart the Citadel server.")
- );
+void tmplput_ExpireMode(StrBuf *Target, WCTemplputParams *TP)
+{
+ GPEXWhichPolicy which;
+ wcsession *WCC = WC;
+
+ which = GetTemplateTokenNumber(Target, TP, 2, 0);
+ if (WCC->Policy[which].loaded == 0) LoadExpirePolicy(which);
+ StrBufAppendPrintf(Target, "%d", WCC->Policy[which].expire_mode);
+}
- sprintf(purger, "%s %s ",
- _("Configure automatic expiry of old messages"),
- _("These settings may be overridden on a per-floor or per-room basis.")
- );
- sprintf(idxjnl, "%s %s ",
- _("Indexing and Journaling"),
- _("Warning: these facilities are resource intensive.")
- );
+void LoadZoneFiles(void)
+{
+ icalarray *zones;
+ int z;
+ long len;
+ const char *this_zone;
+ StrBuf *ZName;
+
+ ZoneHash = NewHash(1, NULL);
+ ZName = NewStrBufPlain(HKEY("UTC"));
+ Put(ZoneHash, HKEY("UTC"), ZName, HFreeStrBuf);
+ zones = icaltimezone_get_builtin_timezones();
+ for (z = 0; z < zones->num_elements; ++z) {
+ /* syslog(9, "Location: %-40s tzid: %s\n",
+ icaltimezone_get_location(icalarray_element_at(zones, z)),
+ icaltimezone_get_tzid(icalarray_element_at(zones, z))
+ ); */
+ this_zone = icaltimezone_get_location(icalarray_element_at(zones, z));
+ len = strlen(this_zone);
+ ZName = NewStrBufPlain(this_zone, len);
+ Put(ZoneHash, this_zone, len, ZName, HFreeStrBuf);
+ }
+ SortByHashKey(ZoneHash, 0);
+}
- wprintf("
");
- sprintf(&access[strlen(access)], "
");
- sprintf(&network[strlen(network)], "
");
- sprintf(&tuning[strlen(tuning)], "
");
- sprintf(&directory[strlen(directory)], "
");
- sprintf(&purger[strlen(purger)], "
");
- sprintf(&idxjnl[strlen(idxjnl)], "
");
-
- tabbed_dialog(7, tabnames);
-
- begin_tab(0, 7); wprintf("%s", general); end_tab(0, 7);
- begin_tab(1, 7); wprintf("%s", access); end_tab(1, 7);
- begin_tab(2, 7); wprintf("%s", network); end_tab(2, 7);
- begin_tab(3, 7); wprintf("%s", tuning); end_tab(3, 7);
- begin_tab(4, 7); wprintf("%s", directory); end_tab(4, 7);
- begin_tab(5, 7); wprintf("%s", purger); end_tab(5, 7);
- begin_tab(6, 7); wprintf("%s", idxjnl); end_tab(6, 7);
-
- wprintf(" ");
- wprintf(" ", _("Save changes"));
- wprintf(" ");
- wprintf(" \n", _("Cancel"));
- wprintf("
\n");
- wprintf("