-const char cgisimple_rcs[] = "$Id: cgisimple.c,v 2.1 2002/07/04 14:35:05 oes Exp $";
+const char cgisimple_rcs[] = "$Id: cgisimple.c,v 2.2 2002/12/28 03:58:19 david__schmidt Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/src/cgisimple.c,v $
*
* Revisions :
* $Log: cgisimple.c,v $
+ * Revision 2.2 2002/12/28 03:58:19 david__schmidt
+ * Initial drop of dashboard instrumentation - enabled with
+ * --enable-activity-console
+ *
* Revision 2.1 2002/07/04 14:35:05 oes
* Added ability to send redirects to send-banner CGI, so that it can completely mimic the image blocking action if called with type=auto
*
const struct map *parameters)
{
char imagetype = lookup(parameters, "type")[0];
+ char *image_mimetype = BUILTIN_IMAGE_MIMETYPE;
/*
* If type is auto, then determine the right thing
{
imagetype = 'p';
}
+ else if (0 == strcmpic(p, "custom"))
+ {
+ imagetype = 'c';
+ }
/*
* If the action is to call this CGI, determine
rsp->body = bindup(image_blank_data, image_blank_length);
rsp->content_length = image_blank_length;
}
+ else if (imagetype == 'c')
+ {
+ rsp->body = bindup(csp->config->image_blocker_data, csp->config->image_blocker_length);
+ rsp->content_length = csp->config->image_blocker_length;
+ image_mimetype = csp->config->image_blocker_format;
+ }
else
{
rsp->body = bindup(image_pattern_data, image_pattern_length);
{
return JB_ERR_MEMORY;
}
- if (enlist(rsp->headers, "Content-Type: " BUILTIN_IMAGE_MIMETYPE))
+ if (enlist(rsp->headers, "Content-Type: "))
+ {
+ return JB_ERR_MEMORY;
+ }
+ if (enlist(rsp->headers, image_mimetype))
{
return JB_ERR_MEMORY;
}
snprintf(buf, 100, "</td><td class=\"buttons\"><a href=\"/show-status?file=actions&index=%d\">View</a> ", i);
if (!err) err = string_append(&s, buf);
+#ifdef FEATURE_CGI_EDIT_ACTIONS
if (NULL == strstr(csp->actions_list[i]->filename, "standard.action") && NULL != csp->config->actions_file_short[i])
{
snprintf(buf, 100, "<a href=\"/edit-actions-list?f=%s\">Edit</a>", csp->config->actions_file_short[i]);
if (!err) err = string_append(&s, buf);
}
+#endif
if (!err) err = string_append(&s, "</td></tr>\n");
}