From 3f2df24202afa6d8314a477ac51958dc28333ced Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sun, 7 Sep 2008 20:43:26 +0000 Subject: [PATCH] * more work on sitewide config --- webcit/siteconfig.c | 2 + webcit/static/t/display_serverrestart.html | 2 +- .../static/t/display_serverrestartpagedo.html | 2 +- webcit/static/t/display_sitewide_config.html | 23 +++++ webcit/static/t/subject_access.html | 1 + webcit/static/t/subject_autopurger.html | 1 + webcit/static/t/subject_directory.html | 1 + webcit/static/t/subject_general.html | 1 + webcit/static/t/subject_indexing.html | 1 + webcit/static/t/subject_network.html | 1 + webcit/static/t/subject_pop3.html | 1 + webcit/static/t/subject_pushmail.html | 1 + webcit/static/t/subject_tuning.html | 1 + webcit/static/t/tab_siteconfig_access.html | 85 +++++++++++++++++++ .../static/t/tab_siteconfig_autopurger.html | 59 +++++++++++++ webcit/static/t/tab_siteconfig_directory.html | 38 +++++++++ webcit/static/t/tab_siteconfig_general.html | 43 ++++++++++ webcit/static/t/tab_siteconfig_indexing.html | 40 +++++++++ webcit/static/t/tab_siteconfig_network.html | 78 +++++++++++++++++ webcit/static/t/tab_siteconfig_pop3.html | 21 +++++ webcit/static/t/tab_siteconfig_pushmail.html | 27 ++++++ webcit/static/t/tab_siteconfig_tuning.html | 40 +++++++++ webcit/subst.c | 27 ++++-- webcit/webserver.c | 2 + 24 files changed, 488 insertions(+), 10 deletions(-) create mode 100644 webcit/static/t/display_sitewide_config.html create mode 100644 webcit/static/t/subject_access.html create mode 100644 webcit/static/t/subject_autopurger.html create mode 100644 webcit/static/t/subject_directory.html create mode 100644 webcit/static/t/subject_general.html create mode 100644 webcit/static/t/subject_indexing.html create mode 100644 webcit/static/t/subject_network.html create mode 100644 webcit/static/t/subject_pop3.html create mode 100644 webcit/static/t/subject_pushmail.html create mode 100644 webcit/static/t/subject_tuning.html create mode 100644 webcit/static/t/tab_siteconfig_access.html create mode 100644 webcit/static/t/tab_siteconfig_autopurger.html create mode 100644 webcit/static/t/tab_siteconfig_directory.html create mode 100644 webcit/static/t/tab_siteconfig_general.html create mode 100644 webcit/static/t/tab_siteconfig_indexing.html create mode 100644 webcit/static/t/tab_siteconfig_network.html create mode 100644 webcit/static/t/tab_siteconfig_pop3.html create mode 100644 webcit/static/t/tab_siteconfig_pushmail.html create mode 100644 webcit/static/t/tab_siteconfig_tuning.html diff --git a/webcit/siteconfig.c b/webcit/siteconfig.c index aa034ca83..5e42ae5a2 100644 --- a/webcit/siteconfig.c +++ b/webcit/siteconfig.c @@ -896,6 +896,8 @@ void load_siteconfig(void) } serv_puts("GPEX site"); + Buf = NewStrBuf(); + Token = NULL; StrBuf_ServGetln(Buf); if (ChrPtr(Buf)[0] == '2') { StrBufCutLeft(Buf, 4); diff --git a/webcit/static/t/display_serverrestart.html b/webcit/static/t/display_serverrestart.html index 5f9f240d9..9ee16012c 100644 --- a/webcit/static/t/display_serverrestart.html +++ b/webcit/static/t/display_serverrestart.html @@ -2,7 +2,7 @@ "http://www.w3.org/TR/html4/strict.dtd"> -<?CURRENT_USER> - <?SERV_HUMANNODE> +<?CURRENT_USER> - <?SERV:HUMANNODE> diff --git a/webcit/static/t/display_serverrestartpagedo.html b/webcit/static/t/display_serverrestartpagedo.html index ac1bedd61..015f88bf6 100644 --- a/webcit/static/t/display_serverrestartpagedo.html +++ b/webcit/static/t/display_serverrestartpagedo.html @@ -2,7 +2,7 @@ "http://www.w3.org/TR/html4/strict.dtd"> -<?CURRENT_USER> - <?SERV_HUMANNODE> +<?CURRENT_USER> - <?SERV:HUMANNODE> diff --git a/webcit/static/t/display_sitewide_config.html b/webcit/static/t/display_sitewide_config.html new file mode 100644 index 000000000..e2bf7a013 --- /dev/null +++ b/webcit/static/t/display_sitewide_config.html @@ -0,0 +1,23 @@ + + + + +
+ + +
+ + + +
+ diff --git a/webcit/static/t/subject_access.html b/webcit/static/t/subject_access.html new file mode 100644 index 000000000..a9986627e --- /dev/null +++ b/webcit/static/t/subject_access.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/subject_autopurger.html b/webcit/static/t/subject_autopurger.html new file mode 100644 index 000000000..781c5cccb --- /dev/null +++ b/webcit/static/t/subject_autopurger.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/subject_directory.html b/webcit/static/t/subject_directory.html new file mode 100644 index 000000000..def1107c6 --- /dev/null +++ b/webcit/static/t/subject_directory.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/subject_general.html b/webcit/static/t/subject_general.html new file mode 100644 index 000000000..e59c2e8dd --- /dev/null +++ b/webcit/static/t/subject_general.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/subject_indexing.html b/webcit/static/t/subject_indexing.html new file mode 100644 index 000000000..1319d4ee5 --- /dev/null +++ b/webcit/static/t/subject_indexing.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/subject_network.html b/webcit/static/t/subject_network.html new file mode 100644 index 000000000..e79a3f98f --- /dev/null +++ b/webcit/static/t/subject_network.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/subject_pop3.html b/webcit/static/t/subject_pop3.html new file mode 100644 index 000000000..499ae00f9 --- /dev/null +++ b/webcit/static/t/subject_pop3.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/subject_pushmail.html b/webcit/static/t/subject_pushmail.html new file mode 100644 index 000000000..394b5c408 --- /dev/null +++ b/webcit/static/t/subject_pushmail.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/subject_tuning.html b/webcit/static/t/subject_tuning.html new file mode 100644 index 000000000..5bb01aeac --- /dev/null +++ b/webcit/static/t/subject_tuning.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/tab_siteconfig_access.html b/webcit/static/t/tab_siteconfig_access.html new file mode 100644 index 000000000..493c8bf08 --- /dev/null +++ b/webcit/static/t/tab_siteconfig_access.html @@ -0,0 +1,85 @@ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+'> + +
+ +
+'> + +
+'> + +
+ +
+ + +
+ +
+ +
+'> + +
+'> + +
+ +
+ +
+ diff --git a/webcit/static/t/tab_siteconfig_autopurger.html b/webcit/static/t/tab_siteconfig_autopurger.html new file mode 100644 index 000000000..e86081de3 --- /dev/null +++ b/webcit/static/t/tab_siteconfig_autopurger.html @@ -0,0 +1,59 @@ +
+

+

+ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webcit/static/t/tab_siteconfig_pop3.html b/webcit/static/t/tab_siteconfig_pop3.html new file mode 100644 index 000000000..d48178f9c --- /dev/null +++ b/webcit/static/t/tab_siteconfig_pop3.html @@ -0,0 +1,21 @@ +
+

+
<_("Hour to run database auto-purge")> + +
+
+
+ + +((sitepolicy == 1) ? "CHECKED" : "" + +
+ ((sitepolicy == 2) ? "CHECKED" : "") ); +
+ + + +
+ + +

+ + +
+ + +
+ + +
+ + +
+ + +
+ +
() + +
+ +
+'> +
+'> +
+ +
+ +
+ + + + + + + + + +
+ +
+ +
+ +
+ +
diff --git a/webcit/static/t/tab_siteconfig_pushmail.html b/webcit/static/t/tab_siteconfig_pushmail.html new file mode 100644 index 000000000..3e46ff170 --- /dev/null +++ b/webcit/static/t/tab_siteconfig_pushmail.html @@ -0,0 +1,27 @@ +
+

+ + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
diff --git a/webcit/static/t/tab_siteconfig_tuning.html b/webcit/static/t/tab_siteconfig_tuning.html new file mode 100644 index 000000000..fed29da27 --- /dev/null +++ b/webcit/static/t/tab_siteconfig_tuning.html @@ -0,0 +1,40 @@ +

+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
diff --git a/webcit/subst.c b/webcit/subst.c index 36630a89c..f3bb28711 100644 --- a/webcit/subst.c +++ b/webcit/subst.c @@ -746,7 +746,8 @@ void ProcessTemplate(WCTemplate *Tmpl, StrBuf *Target, void *Context) const char *pData, *pS; long len; - if (LoadTemplates != 0) { + if (LoadTemplates != 0) { + lprintf(1, "DBG: ----- loading: [%s] ------ \n", ChrPtr(Tmpl->FileName)); pTmpl = load_template(Tmpl->FileName, NULL, NULL); } @@ -884,6 +885,14 @@ void *load_template(StrBuf *filename, StrBuf *Key, HashList *PutThere) return NewTemplate; } + +void PrintTemplate(void *vTemplate) +{ + + +} + + /** * \brief Display a variable-substituted template * \param templatename template file to load @@ -908,6 +917,7 @@ void DoTemplate(const char *templatename, long len, void *Context, StrBuf *Targe if (!GetHash(StaticLocal, templatename, len, &vTmpl) && !GetHash(Static, templatename, len, &vTmpl)) { printf ("didn't find %s\n", templatename); + //print_hash(Static); return; } if (vTmpl == NULL) @@ -1186,13 +1196,14 @@ void InitModule_SUBST (void) { - RegisterNamespace("SERV_PID", 0, 0, tmplput_serv_ip); - RegisterNamespace("SERV_NODENAME", 0, 0, tmplput_serv_nodename); - RegisterNamespace("SERV_HUMANNODE", 0, 0, tmplput_serv_humannode); - RegisterNamespace("SERV_FQDN", 0, 0, tmplput_serv_fqdn); - RegisterNamespace("SERV_SOFTWARE", 0, 0, tmmplput_serv_software); - RegisterNamespace("SERV_REV_LEVEL", 0, 0, tmplput_serv_rev_level); - RegisterNamespace("SERV_BBS_CITY", 0, 0, tmmplput_serv_bbs_city); + RegisterNamespace("SERV:PID", 0, 0, tmplput_serv_ip); + RegisterNamespace("SERV:NODENAME", 0, 0, tmplput_serv_nodename); + RegisterNamespace("SERV:HUMANNODE", 0, 0, tmplput_serv_humannode); + RegisterNamespace("SERV:FQDN", 0, 0, tmplput_serv_fqdn); + RegisterNamespace("SERV:SOFTWARE", 0, 0, tmmplput_serv_software); + RegisterNamespace("SERV:REV_LEVEL", 0, 0, tmplput_serv_rev_level); + RegisterNamespace("SERV:BBS_CITY", 0, 0, tmmplput_serv_bbs_city); +/// RegisterNamespace("SERV:LDAP_SUPP", 0, 0, tmmplput_serv_ldap_enabled); RegisterNamespace("CURRENT_USER", 0, 0, tmplput_current_user); RegisterNamespace("CURRENT_ROOM", 0, 0, tmplput_current_room); RegisterNamespace("ITERATE", 2, 4, tmpl_iterate_subtmpl); diff --git a/webcit/webserver.c b/webcit/webserver.c index aa0a23199..ae20319e5 100644 --- a/webcit/webserver.c +++ b/webcit/webserver.c @@ -307,6 +307,7 @@ long end_burst(void) ptr, count)) == -1) { lprintf(2, "client_write: Socket write failed (%s)\n", strerror(errno)); + wc_backtrace(); return res; } count -= res; @@ -338,6 +339,7 @@ long end_burst(void) ptr, count)) == -1) { lprintf(2, "client_write: Socket write failed (%s)\n", strerror(errno)); + wc_backtrace(); return res; } count -= res; -- 2.30.2