summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-04-20 18:12:56 +0200
committerdefault <nobody@localhost>2023-04-20 18:12:56 +0200
commitbd539b8350d91c1efb42a0269f41bff5b2d99110 (patch)
tree2303df0b6e2d84bfbb0f91b37e9a18d8dcc89512
parent350a489bd086b8ce5f2c86cbfeeaddb4488425a5 (diff)
Replace %admin_email% in greeting.html.
-rw-r--r--httpd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/httpd.c b/httpd.c
index 7f6a428..11f2c28 100644
--- a/httpd.c
+++ b/httpd.c
@@ -64,6 +64,13 @@ int server_get_handler(d_char *req, char *q_path,
/* replace %host% */
s = xs_replace_i(s, "%host%", xs_dict_get(srv_config, "host"));
+ const char *adm_email = xs_dict_get(srv_config, "admin_email");
+ if (xs_is_null(adm_email) || *adm_email == '\0')
+ adm_email = "the administrator of this instance";
+
+ /* replace %admin_email */
+ s = xs_replace_i(s, "%admin_email%", adm_email);
+
/* does it have a %userlist% mark? */
if (xs_str_in(s, "%userlist%") != -1) {
char *host = xs_dict_get(srv_config, "host");