63 |
63 |
|
64 |
64 |
buffer *external_css;
|
65 |
65 |
buffer *encoding;
|
|
66 |
buffer *set_footer;
|
66 |
67 |
} plugin_config;
|
67 |
68 |
|
68 |
69 |
typedef struct {
|
... | ... | |
181 |
182 |
excludes_buffer_free(s->excludes);
|
182 |
183 |
buffer_free(s->external_css);
|
183 |
184 |
buffer_free(s->encoding);
|
|
185 |
buffer_free(s->set_footer);
|
184 |
186 |
|
185 |
187 |
free(s);
|
186 |
188 |
}
|
... | ... | |
254 |
256 |
{ "dir-listing.show-header", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 7 */
|
255 |
257 |
{ "dir-listing.hide-header-file", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
|
256 |
258 |
{ "server.dir-listing", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
|
|
259 |
{ "dir-listing.set-footer", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
|
257 |
260 |
|
258 |
261 |
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
|
259 |
262 |
};
|
... | ... | |
270 |
273 |
s->excludes = excludes_buffer_init();
|
271 |
274 |
s->dir_listing = 0;
|
272 |
275 |
s->external_css = buffer_init();
|
|
276 |
s->set_footer = buffer_init();
|
273 |
277 |
s->hide_dot_files = 0;
|
274 |
278 |
s->show_readme = 0;
|
275 |
279 |
s->hide_readme_file = 0;
|
... | ... | |
287 |
291 |
cv[7].destination = &(s->show_header);
|
288 |
292 |
cv[8].destination = &(s->hide_header_file);
|
289 |
293 |
cv[9].destination = &(s->dir_listing); /* old name */
|
|
294 |
cv[10].destination = s->set_footer;
|
290 |
295 |
|
291 |
296 |
p->config_storage[i] = s;
|
292 |
297 |
ca = ((data_config *)srv->config_context->data[i])->value;
|
... | ... | |
314 |
319 |
PATCH_OPTION(show_header);
|
315 |
320 |
PATCH_OPTION(hide_header_file);
|
316 |
321 |
PATCH_OPTION(excludes);
|
|
322 |
PATCH_OPTION(set_footer);
|
317 |
323 |
|
318 |
324 |
/* skip the first, the global context */
|
319 |
325 |
for (i = 1; i < srv->config_context->used; i++) {
|
... | ... | |
346 |
352 |
PATCH_OPTION(hide_header_file);
|
347 |
353 |
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("dir-listing.excludes"))) {
|
348 |
354 |
PATCH_OPTION(excludes);
|
|
355 |
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("dir-listing.set-footer"))) {
|
|
356 |
PATCH_OPTION(set_footer);
|
349 |
357 |
}
|
350 |
358 |
}
|
351 |
359 |
}
|
... | ... | |
564 |
572 |
"<div class=\"foot\">"
|
565 |
573 |
);
|
566 |
574 |
|
567 |
|
if (buffer_is_empty(con->conf.server_tag)) {
|
|
575 |
if (p->conf.set_footer->used > 1) {
|
|
576 |
buffer_append_string_buffer(out, p->conf.set_footer);
|
|
577 |
} else if (buffer_is_empty(con->conf.server_tag)) {
|
568 |
578 |
BUFFER_APPEND_STRING_CONST(out, PACKAGE_NAME "/" PACKAGE_VERSION);
|
569 |
579 |
} else {
|
570 |
580 |
buffer_append_string_buffer(out, con->conf.server_tag);
|