- char *p, *tmp = NULL;
- char buf[BUFFER_SIZE];
- const struct cgi_dispatcher *d;
- struct map *exports = NULL;
-
- /* List available unhidden CGI's and export as "other-cgis" */
- for (d = cgi_dispatchers; d->handler; d++)
- {
- if (strncmp(d->description, "HIDE", 4))
- {
- snprintf(buf, BUFFER_SIZE, "<li><a href=%s/config/%s>%s</a></li>",
- HOME_PAGE_URL, d->name, d->description);
- tmp = strsav(tmp, buf);
- }
- }
- exports = map(exports, "other-cgis", 1, tmp, 0);
-
- /* If there were other parameters, export a dump as "cgi-parameters" */
- if(parameters)
- {
- p = dump_map(parameters);
- tmp = strsav(tmp, "<p>What made you think this cgi takes options?\n"
- "Anyway, here they are, in case you're interested:</p>\n");
- tmp = strsav(tmp, p);
- exports = map(exports, "cgi-parameters", 1, tmp, 0);
- free(p);
- }
- else
- {
- exports = map(exports, "cgi-parameters", 1, "", 1);
- }
-
- rsp->body = fill_template(csp, "default", exports);
-
- free_map(exports);
- return(0);
-