");
if (!err) err = string_join(&s, html_encode(csp->actions_list[i]->filename));
- snprintf(buf, 100, " | View ", i);
+ snprintf(buf, sizeof(buf),
+ " | View", i);
if (!err) err = string_append(&s, buf);
- if (NULL == strstr(csp->actions_list[i]->filename, "standard.action") && NULL != csp->config->actions_file_short[i])
+#ifdef FEATURE_CGI_EDIT_ACTIONS
+ if ((csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS)
+ && (NULL == strstr(csp->actions_list[i]->filename, "standard.action"))
+ && (NULL != csp->config->actions_file_short[i]))
{
- snprintf(buf, 100, "Edit", csp->config->actions_file_short[i]);
- if (!err) err = string_append(&s, buf);
+#ifdef HAVE_ACCESS
+ if (access(csp->config->actions_file[i], W_OK) == 0)
+ {
+#endif /* def HAVE_ACCESS */
+ snprintf(buf, sizeof(buf), " Edit", i);
+ if (!err) err = string_append(&s, buf);
+#ifdef HAVE_ACCESS
+ }
+ else
+ {
+ if (!err) err = string_append(&s, " No write access.");
+ }
+#endif /* def HAVE_ACCESS */
}
+#endif
if (!err) err = string_append(&s, " |
\n");
}
@@ -842,13 +964,30 @@ jb_err cgi_show_status(struct client_state *csp,
if (!err) err = map(exports, "actions-filenames", 1, "");
+ if (!err) err = string_join(&s, html_encode(csp->rlist[i]->filename));
+ snprintf(buf, sizeof(buf),
+ " | View", i);
+ if (!err) err = string_append(&s, buf);
+ if (!err) err = string_append(&s, " |
\n");
+ }
+ }
+ if (*s != '\0')
{
- if (!err) err = map(exports, "re-filter-filename", 1, html_encode(csp->rlist->filename), 0);
+ if (!err) err = map(exports, "re-filter-filenames", 1, s, 0);
}
else
{
- if (!err) err = map(exports, "re-filter-filename", 1, "None specified", 1);
+ if (!err) err = map(exports, "re-filter-filenames", 1, "