From 7d378376444be8489ed9958b93520ddeae209789 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Fri, 10 Feb 2006 10:32:35 +0000 Subject: [PATCH] Fixed illegal submit from curl() SVN revision: 1655 --- src/elogd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index c622a6f1..74b3c08f 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -15448,8 +15448,12 @@ BOOL is_command_allowed(LOGBOOK * lbs, char *command) strlcat(menu_str, "Config, ", sizeof(menu_str)); } - strcpy(other_str, "Update, Upload, Submit, Preview, Back, Search, Save, Download, CSV Import, "); - strcat(other_str, "Cancel, First, Last, Previous, Next, Requested, Forgot, "); + strcpy(other_str, "Preview, Back, Search, Download, CSV Import, "); + strlcat(other_str, "Cancel, First, Last, Previous, Next, Requested, Forgot, ", sizeof(other_str)); + + /* only allow Submit & Co if "New" is allowed */ + if (strstr(menu_str, "New")) + strlcat(other_str, "Update, Upload, Submit, Save, ", sizeof(other_str)); /* admin commands */ if (is_admin_user(lbs->name, getparam("unm"))) { @@ -15467,7 +15471,7 @@ BOOL is_command_allowed(LOGBOOK * lbs, char *command) return TRUE; } /* exclude non-localized submit for elog */ - else if (command[0] && strieq(command, "Submit")) { + else if (command[0] && strieq(command, "Submit") && strstr(menu_str, "New")) { return TRUE; } /* exclude other non-localized commands */